diff options
author | Péter Szilágyi <peterke@gmail.com> | 2019-01-04 15:51:12 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-04 15:51:12 +0800 |
commit | 391d4cb9b53eb9f71862cbb8a6cca332d5a76f94 (patch) | |
tree | 7697f49be5353066df0968ff8af4169dfda2cdb1 /p2p/enode/idscheme.go | |
parent | 3f421aca54bb5216e0f949966481fa4516c52273 (diff) | |
parent | 8ec344bf604a56e4bd313660448345708c5aeb51 (diff) | |
download | go-tangerine-391d4cb9b53eb9f71862cbb8a6cca332d5a76f94.tar go-tangerine-391d4cb9b53eb9f71862cbb8a6cca332d5a76f94.tar.gz go-tangerine-391d4cb9b53eb9f71862cbb8a6cca332d5a76f94.tar.bz2 go-tangerine-391d4cb9b53eb9f71862cbb8a6cca332d5a76f94.tar.lz go-tangerine-391d4cb9b53eb9f71862cbb8a6cca332d5a76f94.tar.xz go-tangerine-391d4cb9b53eb9f71862cbb8a6cca332d5a76f94.tar.zst go-tangerine-391d4cb9b53eb9f71862cbb8a6cca332d5a76f94.zip |
Merge pull request #18390 from realdave/remove-sha3-pkg
vendor, crypto, swarm: switch over to upstream sha3 package
Diffstat (limited to 'p2p/enode/idscheme.go')
-rw-r--r-- | p2p/enode/idscheme.go | 6 |
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 |