whisper: message format refactoring (#14335)

* whisper: salt removed from AES encryption
* whisper: padding format updated
* whisper: padding test added
* whisper: padding refactored, tests fixed
* whisper: padding test updated
* whisper: wnode bugfix
* whisper: send/receive protocol updated
* whisper: minor update
* whisper: bugfix in test
* whisper: updated parameter names and comments
* whisper: functions renamed
* whisper: minor refactoring
This commit is contained in:
gluk256
2017-04-26 21:05:48 +02:00
committed by Felix Lange
parent 8dce4c283d
commit 95f0bd0acf
14 changed files with 343 additions and 232 deletions

View File

@ -49,18 +49,16 @@ const (
paddingMask = byte(3)
signatureFlag = byte(4)
TopicLength = 4
signatureLength = 65
aesKeyLength = 32
saltLength = 12
AESNonceMaxLength = 12
keyIdSize = 32
TopicLength = 4
signatureLength = 65
aesKeyLength = 32
AESNonceLength = 12
keyIdSize = 32
DefaultMaxMessageLength = 1024 * 1024
DefaultMinimumPoW = 1.0 // todo: review after testing.
DefaultMinimumPoW = 0.2
padSizeLimitLower = 128 // it can not be less - we don't want to reveal the absence of signature
padSizeLimitUpper = 256 // just an arbitrary number, could be changed without losing compatibility
padSizeLimit = 256 // just an arbitrary number, could be changed without breaking the protocol (must not exceed 2^24)
messageQueueLimit = 1024
expirationCycle = time.Second