Skip to content

Commit

Permalink
Fix AEAD stream writer to write a big chunk buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamacro committed Sep 21, 2018
1 parent 1a4dead commit 637009c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion shadowaead/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (w *Writer) Write(p []byte) (n int, err error) {
buf[0], buf[1] = byte(nr>>8), byte(nr) // big-endian payload size
w.Seal(buf[:0], nonce, buf[:2], nil)
increment(nonce)
w.Seal(buf[:off], nonce, p[:nr], nil)
w.Seal(buf[:off], nonce, p[n:n+nr], nil)
increment(nonce)
_, err = w.Writer.Write(buf)
}
Expand Down

0 comments on commit 637009c

Please sign in to comment.