Skip to content

Commit

Permalink
remove unnecessary var
Browse files Browse the repository at this point in the history
  • Loading branch information
convto committed Feb 25, 2024
1 parent d3460c0 commit e34efe0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions chacha20.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,11 @@ func (c *state) keyStream() [64]byte {
x[2], x[7], x[8], x[13] = qr(x[2], x[7], x[8], x[13])
x[3], x[4], x[9], x[14] = qr(x[3], x[4], x[9], x[14])
}
z := state{}
for i, v := range x {
z[i] = c[i] + v
for i := range x {
x[i] += c[i]
}
var stream [64]byte
for i, v := range z {
for i, v := range x {
stream[i*4] = byte(v)
stream[i*4+1] = byte(v >> 8)
stream[i*4+2] = byte(v >> 16)
Expand Down

0 comments on commit e34efe0

Please sign in to comment.