salsa20: panic when len(out) < len(in) following cipher.Stream
Change-Id: I5c8d603cc3ec844b8d44e51b3138bcf16e95c7fc Reviewed-on: https://go-review.googlesource.com/112235 Reviewed-by: Adam Langley <agl@golang.org> Run-TryBot: Filippo Valsorda <filippo@golang.org>
This commit is contained in:
+1
-1
@@ -32,7 +32,7 @@ import (
|
|||||||
// be either 8 or 24 bytes long.
|
// be either 8 or 24 bytes long.
|
||||||
func XORKeyStream(out, in []byte, nonce []byte, key *[32]byte) {
|
func XORKeyStream(out, in []byte, nonce []byte, key *[32]byte) {
|
||||||
if len(out) < len(in) {
|
if len(out) < len(in) {
|
||||||
in = in[:len(out)]
|
panic("salsa20: output smaller than input")
|
||||||
}
|
}
|
||||||
|
|
||||||
var subNonce [16]byte
|
var subNonce [16]byte
|
||||||
|
|||||||
Reference in New Issue
Block a user