whisper/whisperv6: remove aesnonce (#15578)

As per EIP-627, the salt for symmetric encryption is now
part of the payload. This commit does that.
This commit is contained in:
Guillaume Ballet
2017-12-08 11:40:59 +01:00
committed by Felix Lange
parent b5874273ce
commit d95962cd5d
8 changed files with 168 additions and 73 deletions

View File

@@ -591,13 +591,6 @@ func (wh *Whisper) add(envelope *Envelope) (bool, error) {
return false, fmt.Errorf("oversized version [%x]", envelope.Hash())
}
aesNonceSize := len(envelope.AESNonce)
if aesNonceSize != 0 && aesNonceSize != AESNonceLength {
// the standard AES GCM nonce size is 12 bytes,
// but constant gcmStandardNonceSize cannot be accessed (not exported)
return false, fmt.Errorf("wrong size of AESNonce: %d bytes [env: %x]", aesNonceSize, envelope.Hash())
}
if envelope.PoW() < wh.MinPow() {
log.Debug("envelope with low PoW dropped", "PoW", envelope.PoW(), "hash", envelope.Hash().Hex())
return false, nil // drop envelope without error