-
Notifications
You must be signed in to change notification settings - Fork 78
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
Support native PBKDF2 #961
base: openj9
Are you sure you want to change the base?
Conversation
@jasonkatonica FYI |
8cfeb4b
to
a744174
Compare
closed/src/java.base/share/classes/jdk/crypto/jniprovider/NativeCrypto.java
Show resolved
Hide resolved
closed/src/java.base/share/classes/jdk/crypto/jniprovider/NativeCrypto.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java
Outdated
Show resolved
Hide resolved
abc7b61
to
6522dc8
Compare
src/java.base/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java
Outdated
Show resolved
Hide resolved
6522dc8
to
cf418d1
Compare
ec2a129
to
e93838f
Compare
A native implementation of the following PBKDF2 related crypto sevices are supported to optimze the PBKDF2 key derivations performance. - PBKDF2WithHmacSHA1 - PBKDF2WithHmacSHA224 - PBKDF2WithHmacSHA256 - PBKDF2WithHmacSHA384 - PBKDF2WithHmacSHA512 - PBKDF2WithHmacSHA512/224 - PBKDF2WithHmacSHA512/256 A new JVM option (jdk.nativePBKDF2) is provided to enable the use of the native PBKDF2 implementation, which is disabled by default. Signed-off-by: Jinhang Zhang <[email protected]>
e93838f
to
87098db
Compare
@@ -3845,3 +3857,89 @@ Java_jdk_crypto_jniprovider_NativeCrypto_XDHGenerateSecret | |||
} | |||
return ret; | |||
} | |||
|
|||
/* Password based key derivation functions |
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.
Typo, missing period:
/* Password based key derivation function.
*/ | ||
JNIEXPORT jbyteArray JNICALL | ||
Java_jdk_crypto_jniprovider_NativeCrypto_PBKDF2Derive | ||
(JNIEnv *env, jclass clazz, jbyteArray password, jbyteArray salt, jint iterations, jint keyLength, jint hashAlgorithm) |
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.
The second parameter is not a class as this function implements a non-static method. Please ensure all signatures are correct and consistently use jclass clazz
for static methods and jobject thisObj
for non-static methods.
A native implementation of the following PBKDF2 related crypto sevices are supported to optimze the PBKDF2 key derivations performance.
A new JVM option (
jdk.nativePBKDF2
) is provided to enable the use of the native PBKDF2 implementation, which is disabled by default.