-
Notifications
You must be signed in to change notification settings - Fork 56
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
Enable standalone ACCP Ed25519 #438
base: main
Are you sure you want to change the base?
Conversation
d60584a
to
eb9a7d2
Compare
b13f432
to
5b217fd
Compare
@@ -87,10 +87,12 @@ public static void setupParameters() throws Exception { | |||
|
|||
for (String algorithm : ALGORITHMS) { | |||
KeyPairGenerator kpg; | |||
if (algorithm.startsWith("ML-DSA")) { | |||
if (algorithm.startsWith("ML-DSA") | |||
|| (algorithm.startsWith("Ed") && TestUtil.getJavaVersion() < 15)) { |
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.
Bit of code smell here, I'm paranoid that matching on startsWith("Ed") is a bit too general.
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.
This is very fair. Since it's a maintainability issue and not a correctness issue, I'll do a follow-up PR to match algorithm
more precisely.
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.
Two nits. Otherwise LGTM.
Issue #, if available:
Description of changes:
Notes
PR #394 deliberately coupled ACCP's Ed25519 key generation to SunEC's KeyFactory in the hopes of increasing compatibility. However, this also prevents the use of Ed25519 in standalone ACCP. This PR provides a fallback mechanism to allow Ed25519 keys to be generated by standalone ACCP without relying on SunEC. If SunEC has a relevant KeyFactory registered, the old behavior is retained for backwards compatibility.
Conveniently, this fallback mechanism also allows us to provide Ed25519 support on JDK versions < 15.
Testing
We add a test that de- and re-registers default providers to prove Ed25519 signatures can be performed by standalone ACCP with an empty JCA registry.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.