Skip to content

Commit

Permalink
fix flaky aes decrypt test
Browse files Browse the repository at this point in the history
  • Loading branch information
fredcarle committed Nov 14, 2024
1 parent 909c4af commit db8c7da
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions crypto/aes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,10 @@ func TestDecryptAES(t *testing.T) {
errorContains: "message authentication failed",
},
{
name: "Tampered ciphertext",
nonce: validNonce,
cipherText: append([]byte{0}, validCiphertext[AESNonceSize+1:]...),
name: "Tampered ciphertext",
nonce: validNonce,
// Flip a byte in the ciphertext to corrupt it.
cipherText: append([]byte{^validCiphertext[AESNonceSize]}, validCiphertext[AESNonceSize+1:]...),
key: validKey,
additionalData: validAAD,
expectError: true,
Expand Down

0 comments on commit db8c7da

Please sign in to comment.