From 23ac78333201890deed23576668810e19df2c67e Mon Sep 17 00:00:00 2001 From: David Huie Date: Mon, 26 Mar 2018 03:46:18 -0700 Subject: 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. --- whisper/whisperv5/message.go | 2 +- whisper/whisperv6/message.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'whisper') diff --git a/whisper/whisperv5/message.go b/whisper/whisperv5/message.go index c27535cd1..34ce52e64 100644 --- a/whisper/whisperv5/message.go +++ b/whisper/whisperv5/message.go @@ -277,7 +277,7 @@ func (msg *ReceivedMessage) decryptSymmetric(key []byte, nonce []byte) error { // decryptAsymmetric decrypts an encrypted payload with a private key. func (msg *ReceivedMessage) decryptAsymmetric(key *ecdsa.PrivateKey) error { - decrypted, err := ecies.ImportECDSA(key).Decrypt(crand.Reader, msg.Raw, nil, nil) + decrypted, err := ecies.ImportECDSA(key).Decrypt(msg.Raw, nil, nil) if err == nil { msg.Raw = decrypted } diff --git a/whisper/whisperv6/message.go b/whisper/whisperv6/message.go index b8318cbe8..2d4e86244 100644 --- a/whisper/whisperv6/message.go +++ b/whisper/whisperv6/message.go @@ -289,7 +289,7 @@ func (msg *ReceivedMessage) decryptSymmetric(key []byte) error { // decryptAsymmetric decrypts an encrypted payload with a private key. func (msg *ReceivedMessage) decryptAsymmetric(key *ecdsa.PrivateKey) error { - decrypted, err := ecies.ImportECDSA(key).Decrypt(crand.Reader, msg.Raw, nil, nil) + decrypted, err := ecies.ImportECDSA(key).Decrypt(msg.Raw, nil, nil) if err == nil { msg.Raw = decrypted } -- cgit