-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[improve][misc] Improve AES-GCM cipher performance #23122
Conversation
d86759f
to
0021f17
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@lhotari Agree. |
(cherry picked from commit e9deb40)
(cherry picked from commit 354a9f0)
(cherry picked from commit 354a9f0)
Fixes #23121
Motivation
BouncyCastleProvider
for AES-GCM encryption, which is known to be slow due to the lack of hardware instruction optimization.Modifications
MessageCryptoBc
to useSunJCE
provider which comes with hardware-instruction optimization instead ofBouncyCastle
provider.Verifying this change
This change is already covered by existing tests, such as
org.apache.pulsar.tests.integration.SimpleProducerConsumerTest
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: Pulsar CI workflow run result