Skip to content

Commit

Permalink
Use LibCryptoRng instead of DEFAULT in Random benchmark (#392)
Browse files Browse the repository at this point in the history
Following reversal of PR #376 in PR #388, using the ACCP SecureRandom
algorithm `DEFAULT` (which is an alias of `LibCryptoRng`) yields lower
performance in multi-threaded settings.
See #376 for details.

This PR is meant to use the algorithm `LibCryptoRng` in the benchmark,
instead of its alias `DEFAULT`. This solves the performance drop in
multi-threaded settings.

This also corresponds to the most common use of ACCP SecureRandom.
Indeed, if ACCP is the first security provider and if ACCP SecureRandom
 is registered, then when instantiating SecureRandom as
 `new SecureRandom()`, the algorithm `LibCryptoRng` will be selected.

Co-authored-by: Fabrice Benhamouda <[email protected]>
  • Loading branch information
fabrice102 and Fabrice Benhamouda authored Jul 25, 2024
1 parent a71a758 commit 5071483
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static class Shared {
// !!! WARNING: java.util.random is not a secure randomness generator
// !!! WARNING: we add it here just for comparison
@Param({
AmazonCorrettoCryptoProvider.PROVIDER_NAME + "/DEFAULT",
AmazonCorrettoCryptoProvider.PROVIDER_NAME + "/LibCryptoRng",
"BC/DEFAULT",
"SUN/NativePrng",
"SUN/DRBG",
Expand Down

0 comments on commit 5071483

Please sign in to comment.