Add size clamping
This commit is contained in:
parent
23af60ac88
commit
01792a7f59
|
@ -54,7 +54,7 @@ func Decrypt(key []byte, ciphertext []byte, additionalData []byte) ([]byte, bool
|
||||||
return nil, false, errors.New("Failed to decrypt")
|
return nil, false, errors.New("Failed to decrypt")
|
||||||
}
|
}
|
||||||
|
|
||||||
return plaintext, true, nil
|
return plaintext[:plaintextLen], true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func genNonce() []byte {
|
func genNonce() []byte {
|
||||||
|
|
Loading…
Reference in New Issue