Skip to content

Commit

Permalink
zuc: refactor the eea test case issue #284
Browse files Browse the repository at this point in the history
  • Loading branch information
emmansun authored Dec 5, 2024
1 parent ddb5b69 commit 14087e2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions zuc/eea_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,15 @@ func TestIssue284(t *testing.T) {
if err != nil {
t.Error(err)
}
src := make([]byte, 200)
expected := make([]byte, 200)
dst := make([]byte, 200)
src := make([]byte, RoundBytes*2)
expected := make([]byte, RoundBytes*2)
dst := make([]byte, RoundBytes*2)
c.XORKeyStream(expected, src)

for i := 124; i <= 200; i++ {
for i := RoundBytes - 3; i < RoundBytes+5; i++ {
c.XORKeyStreamAt(dst, src[:i], 0)
if !bytes.Equal(expected[:i], dst[:i]) {
c.XORKeyStream(dst[i:], src[i:])
if !bytes.Equal(expected, dst) {
t.Fatalf("failed for len %v", i)
}
}
Expand Down

0 comments on commit 14087e2

Please sign in to comment.