[improve][misc] Improve AES-GCM cipher performance#23122
Conversation
d86759f to
0021f17
Compare
There was a problem hiding this comment.
Thanks for the contribution @ocadaruma!
The only concern I have about the change is the users of Pulsar that require FIPS compliant encryption. Pulsar has docs about enabling BouncyCastle's FIPS library in https://pulsar.apache.org/docs/3.3.x/security-bouncy-castle/. It's seems when the FIPS library is enabled, the SunJCE provider shouldn't be made the default. I'll add a suggestion about how to achieve this.
UPDATE: The previous solution has already ignored the presence of BouncyCastleFipsProvider, so I think that the changes in this PR are fine. The issue in FIPS compliance is a separate issue.
|
@lhotari Agree. |
(cherry picked from commit e9deb40)
(cherry picked from commit 354a9f0)
(cherry picked from commit 354a9f0)
Fixes #23121
Motivation
BouncyCastleProviderfor AES-GCM encryption, which is known to be slow due to the lack of hardware instruction optimization.Modifications
MessageCryptoBcto useSunJCEprovider which comes with hardware-instruction optimization instead ofBouncyCastleprovider.Verifying this change
This change is already covered by existing tests, such as
org.apache.pulsar.tests.integration.SimpleProducerConsumerTestDoes this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: Pulsar CI workflow run result