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 committed Mar 7, 2024
1 parent 58fda59 commit e8f8772
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 e8f8772

Please sign in to comment.