corretto / amazon-corretto-crypto-provider

The Amazon Corretto Crypto Provider is a collection of high-performance cryptographic implementations exposed via standard JCA/JCE interfaces.
Apache License 2.0
236 stars 55 forks source link

Use `LibCryptoRng` instead of `DEFAULT` in Random benchmark #392

Closed fabrice102 closed 3 months ago

fabrice102 commented 3 months ago

Issue #, if available: N/A

Description of changes:

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.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.