salsa20: panic when len(out) < len(in) following cipher.Stream
Run-TryBot: Filippo Valsorda
@@ -32,7 +32,7 @@ import (
// be either 8 or 24 bytes long.
func XORKeyStream(out, in []byte, nonce []byte, key *[32]byte) {
if len(out) < len(in) {
- in = in[:len(out)]
+ panic("salsa20: output smaller than input")
}
var subNonce [16]byte
