aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/whisperv6/message_test.go
diff options
context:
space:
mode:
authorGuillaume Ballet <gballet@gmail.com>2017-12-08 18:40:59 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-12-08 18:40:59 +0800
commitd95962cd5d3ea163f8e91d7a9ca2f6303799b2e2 (patch)
tree7255f029c04eb4e66e07b757c1ef44ecd1edb986 /whisper/whisperv6/message_test.go
parentb5874273cec729adce84acf5848536d20fb60f7c (diff)
downloaddexon-d95962cd5d3ea163f8e91d7a9ca2f6303799b2e2.tar
dexon-d95962cd5d3ea163f8e91d7a9ca2f6303799b2e2.tar.gz
dexon-d95962cd5d3ea163f8e91d7a9ca2f6303799b2e2.tar.bz2
dexon-d95962cd5d3ea163f8e91d7a9ca2f6303799b2e2.tar.lz
dexon-d95962cd5d3ea163f8e91d7a9ca2f6303799b2e2.tar.xz
dexon-d95962cd5d3ea163f8e91d7a9ca2f6303799b2e2.tar.zst
dexon-d95962cd5d3ea163f8e91d7a9ca2f6303799b2e2.zip
whisper/whisperv6: remove aesnonce (#15578)
As per EIP-627, the salt for symmetric encryption is now part of the payload. This commit does that.
Diffstat (limited to 'whisper/whisperv6/message_test.go')
-rw-r--r--whisper/whisperv6/message_test.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/whisper/whisperv6/message_test.go b/whisper/whisperv6/message_test.go
index 912b90f14..281a852d6 100644
--- a/whisper/whisperv6/message_test.go
+++ b/whisper/whisperv6/message_test.go
@@ -174,10 +174,8 @@ func TestMessageSeal(t *testing.T) {
t.Fatalf("failed to create new message with seed %d: %s.", seed, err)
}
params.TTL = 1
- aesnonce := make([]byte, 12)
- mrand.Read(aesnonce)
- env := NewEnvelope(params.TTL, params.Topic, aesnonce, msg)
+ env := NewEnvelope(params.TTL, params.Topic, msg)
if err != nil {
t.Fatalf("failed Wrap with seed %d: %s.", seed, err)
}
@@ -242,7 +240,12 @@ func singleEnvelopeOpenTest(t *testing.T, symmetric bool) {
t.Fatalf("failed Wrap with seed %d: %s.", seed, err)
}
- f := Filter{KeyAsym: key, KeySym: params.KeySym}
+ var f Filter
+ if symmetric {
+ f = Filter{KeySym: params.KeySym}
+ } else {
+ f = Filter{KeyAsym: key}
+ }
decrypted := env.Open(&f)
if decrypted == nil {
t.Fatalf("failed to open with seed %d.", seed)