Skip to content
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

Merge latest OpenJ9 changes to 0.41 #689

Merged
merged 4 commits into from
Sep 8, 2023
Merged

Merge latest OpenJ9 changes to 0.41 #689

merged 4 commits into from
Sep 8, 2023

Conversation

pshipton
Copy link
Member

@pshipton pshipton commented Sep 8, 2023

No description provided.

jasonkatonica and others added 4 commits September 7, 2023 11:59
The EVP cipher initialization cost has been found to be expensive in
the `OpenSSL 3.x` API compared to the `OpenSSL 1.x` API.

This update allows for two different types of initializations to occur.
The first initialization type is a full initialization which sets the key,
iv, and EVP cipher context. The second type of initialization sets just
the key and iv and does NOT recreate and reinitialize the EVP context.
The former of these two is required once per Cipher instance, the later
of these two can be used whenever we are reusing a specific
Java cipher object within methods such as `Cipher.doFinal()`.

Signed-off by: Jason Katonica <katonica@us.ibm.com>
It has been identified that when using `OpenSSL` version `3.x` the
message digest context initialization is much more expensive than using
`OpenSSL` version `1.x`. This update optimizes the use of `OpenSSL`
contexts by making use of a simple cache.

We will create a second initialized openssl digest context when the
message digest cipher is initialized. This second context, defined as
`context->cachedInitalizedDigestContext`, will be copied over the
working context, `context->ctx`, using the `EVP_MD_CTX_copy_ex` API
whenever we wish to re-initalize this cipher. The restoration of a
context occurs whenever a cipher is explictly reset or whenever a final
digest is computed.

Backported from:

ibmruntimes/openj9-openjdk-jdk#643

Signed-off by: Jason Katonica <katonica@us.ibm.com>
@JasonFengJ9 JasonFengJ9 merged commit 6530f59 into v0.41.0-release Sep 8, 2023
9 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants