p2p/rlpx: use crypto/subtle.XORBytes directly

This commit is contained in:
Felix Lange 2025-12-08 15:32:04 +01:00
parent da98e12697
commit 5a484d2393

View file

@ -24,6 +24,7 @@ import (
"crypto/ecdsa"
"crypto/hmac"
"crypto/rand"
"crypto/subtle"
"encoding/binary"
"errors"
"fmt"
@ -33,7 +34,6 @@ import (
"net"
"time"
"github.com/ethereum/go-ethereum/common/bitutil"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto/ecies"
"github.com/ethereum/go-ethereum/rlp"
@ -677,6 +677,6 @@ func exportPubkey(pub *ecies.PublicKey) []byte {
func xor(one, other []byte) (xor []byte) {
xor = make([]byte, len(one))
bitutil.XORBytes(xor, one, other)
subtle.XORBytes(xor, one, other)
return xor
}