Skip to content

Commit

Permalink
Use LibCryptoRng for random IV
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Rubin authored and geedo0 committed Mar 8, 2024
1 parent 455311c commit 9d1f26d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/com/amazon/corretto/crypto/provider/AesGcmSpi.java
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ protected AlgorithmParameters engineGetParameters() {
if (ivForParams == null) {
// We aren't initialized so we return default and random values
ivForParams = new byte[DEFAULT_IV_LENGTH_BYTES];
new SecureRandom().nextBytes(ivForParams);
new LibCryptoRng().nextBytes(ivForParams);
}
parameters.init(new GCMParameterSpec(tagLength * 8, ivForParams));
return parameters;
Expand Down

0 comments on commit 9d1f26d

Please sign in to comment.