aboutsummaryrefslogtreecommitdiffstats
path: root/whisper
diff options
context:
space:
mode:
authorDavid Huie <dahuie@gmail.com>2018-03-26 18:46:18 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-03-26 18:46:18 +0800
commit23ac78333201890deed23576668810e19df2c67e (patch)
tree9fec733ac31c09f76c32ca9443466d1c27c84fa0 /whisper
parente9a1d8de3407f2d319ad2d8f86761cc51c3ec9a4 (diff)
downloaddexon-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 'whisper')
-rw-r--r--whisper/whisperv5/message.go2
-rw-r--r--whisper/whisperv6/message.go2
2 files changed, 2 insertions, 2 deletions
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
}