Skip to content

Commit

Permalink
Fix the bug in CipherTest.checkAEADParemeter
Browse files Browse the repository at this point in the history
  • Loading branch information
gefeili committed Jan 8, 2025
1 parent 806a465 commit 0098895
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ static void checkAEADParemeter(SimpleTest test, int keySize, int ivSize, final i
}
int len = cipher.processBytes(plaintext, 0, plaintext.length, ciphertext1, 0);
len += cipher.doFinal(ciphertext1, len);
int aadSplit = random.nextInt(99);
int aadSplit = random.nextInt(aad.length);
cipher.init(true, new AEADParameters(new KeyParameter(key), macSize * 8, iv, Arrays.copyOf(aad, aadSplit)));
cipher.processAADBytes(aad, aadSplit, aad.length - aadSplit);
byte[] ciphertext2 = new byte[cipher.getOutputSize(plaintext.length)];
Expand Down

0 comments on commit 0098895

Please sign in to comment.