Add size clamping

This commit is contained in:
Simon 2022-02-05 02:24:34 +00:00
parent 23af60ac88
commit 01792a7f59
1 changed files with 1 additions and 1 deletions

View File

@ -54,7 +54,7 @@ func Decrypt(key []byte, ciphertext []byte, additionalData []byte) ([]byte, bool
return nil, false, errors.New("Failed to decrypt")
}
return plaintext, true, nil
return plaintext[:plaintextLen], true, nil
}
func genNonce() []byte {