aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/enode/idscheme.go
diff options
context:
space:
mode:
authorDave McGregor <dave.s.mcgregor@gmail.com>2019-01-04 06:15:26 +0800
committerPéter Szilágyi <peterke@gmail.com>2019-01-04 15:26:07 +0800
commit33d233d3e18359123993d3f54987441290faf212 (patch)
tree6c203ca106f29eb3525df9bdd4737b1ecb48b77d /p2p/enode/idscheme.go
parent49975264a8d37aa9af1a2b71015059245c0c2e0b (diff)
downloadgo-tangerine-33d233d3e18359123993d3f54987441290faf212.tar
go-tangerine-33d233d3e18359123993d3f54987441290faf212.tar.gz
go-tangerine-33d233d3e18359123993d3f54987441290faf212.tar.bz2
go-tangerine-33d233d3e18359123993d3f54987441290faf212.tar.lz
go-tangerine-33d233d3e18359123993d3f54987441290faf212.tar.xz
go-tangerine-33d233d3e18359123993d3f54987441290faf212.tar.zst
go-tangerine-33d233d3e18359123993d3f54987441290faf212.zip
vendor, crypto, swarm: switch over to upstream sha3 package
Diffstat (limited to 'p2p/enode/idscheme.go')
-rw-r--r--p2p/enode/idscheme.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/p2p/enode/idscheme.go b/p2p/enode/idscheme.go
index 9b495fd4f..c1834f069 100644
--- a/p2p/enode/idscheme.go
+++ b/p2p/enode/idscheme.go
@@ -23,9 +23,9 @@ import (
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/crypto"
- "github.com/ethereum/go-ethereum/crypto/sha3"
"github.com/ethereum/go-ethereum/p2p/enr"
"github.com/ethereum/go-ethereum/rlp"
+ "golang.org/x/crypto/sha3"
)
// List of known secure identity schemes.
@@ -48,7 +48,7 @@ func SignV4(r *enr.Record, privkey *ecdsa.PrivateKey) error {
cpy.Set(enr.ID("v4"))
cpy.Set(Secp256k1(privkey.PublicKey))
- h := sha3.NewKeccak256()
+ h := sha3.NewLegacyKeccak256()
rlp.Encode(h, cpy.AppendElements(nil))
sig, err := crypto.Sign(h.Sum(nil), privkey)
if err != nil {
@@ -69,7 +69,7 @@ func (V4ID) Verify(r *enr.Record, sig []byte) error {
return fmt.Errorf("invalid public key")
}
- h := sha3.NewKeccak256()
+ h := sha3.NewLegacyKeccak256()
rlp.Encode(h, r.AppendElements(nil))
if !crypto.VerifySignature(entry, h.Sum(nil), sig) {
return enr.ErrInvalidSig