Skip to content

Commit

Permalink
salsa20: fix panic in test
Browse files Browse the repository at this point in the history
This avoids a panic introduced by https://go-review.googlesource.com/112235

Fixes issue #3
  • Loading branch information
davidlazar committed Sep 12, 2019
1 parent 62389b5 commit 7055855
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion salsa20/salsa20_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestRandom(t *testing.T) {
x := randInt(len(msg))
c3 := make([]byte, len(msg)-x)
c4 := make([]byte, len(msg)-x)
salsa20.XORKeyStream(c3, msg, nonce, &key)
salsa20.XORKeyStream(c3, msg[:len(msg)-x], nonce, &key)
XORKeyStream(c4, msg, nonce, &key)
if !bytes.Equal(c3, c4) {
t.Fatalf("key=%x nonce=%x msg=%x\n expected=%x\n actually=%x", key, nonce, msg, c3, c4)
Expand Down

0 comments on commit 7055855

Please sign in to comment.