diff options
author | David Huie <dahuie@gmail.com> | 2018-03-26 18:46:18 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-03-26 18:46:18 +0800 |
commit | 23ac78333201890deed23576668810e19df2c67e (patch) | |
tree | 9fec733ac31c09f76c32ca9443466d1c27c84fa0 /p2p | |
parent | e9a1d8de3407f2d319ad2d8f86761cc51c3ec9a4 (diff) | |
download | dexon-23ac78333201890deed23576668810e19df2c67e.tar.gz dexon-23ac78333201890deed23576668810e19df2c67e.tar.zst dexon-23ac78333201890deed23576668810e19df2c67e.zip |
ecies: drop randomness parameter from `PrivateKey.Decrypt` (#16374)
The parameter `rand` is unused in `PrivateKey.Decrypt`. Decryption in
the ECIES encryption scheme is deterministic, so randomness isn't
needed.
Diffstat (limited to 'p2p')
-rw-r--r-- | p2p/rlpx.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/p2p/rlpx.go b/p2p/rlpx.go index 1889edac9..a320e81e7 100644 --- a/p2p/rlpx.go +++ b/p2p/rlpx.go @@ -491,7 +491,7 @@ func readHandshakeMsg(msg plainDecoder, plainSize int, prv *ecdsa.PrivateKey, r } // Attempt decoding pre-EIP-8 "plain" format. key := ecies.ImportECDSA(prv) - if dec, err := key.Decrypt(rand.Reader, buf, nil, nil); err == nil { + if dec, err := key.Decrypt(buf, nil, nil); err == nil { msg.decodePlain(dec) return buf, nil } @@ -505,7 +505,7 @@ func readHandshakeMsg(msg plainDecoder, plainSize int, prv *ecdsa.PrivateKey, r if _, err := io.ReadFull(r, buf[plainSize:]); err != nil { return buf, err } - dec, err := key.Decrypt(rand.Reader, buf[2:], nil, prefix) + dec, err := key.Decrypt(buf[2:], nil, prefix) if err != nil { return buf, err } |