-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8360939: Support X-Wing KEM #26032
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
base: master
Are you sure you want to change the base?
8360939: Support X-Wing KEM #26032
Conversation
… braces to if blocks
* if algorithm is known to exist in same provider (SunJCE), throw AssertionError * if algorithm requires a different provider (which can theoretically be disabled), throw UnsupportedOperationException
|
👋 Welcome back overheadhunter! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
@overheadhunter The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
overheadhunter
left a comment
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.
@wangweij note that I use different unchecked exception types when catching NoSuchAlgorithmException:
If the algorithm exists in the same provider (SunJCE), I assert it exists, throwing an AssertionError. For algorithms defined in other providers, I can not make this assertion, as they might not be present at runtime. In these cases I use an UnsupportedOperationException.
However, I'm not too happy with this. What is the best practice to deal with algorithm dependencies? Can we somehow check whether all dependencies exist a priori?
| System.arraycopy(pkX, 0, input, ssM.length + ssX.length + ctX.length, pkX.length); | ||
| System.arraycopy(X_WING_LABEL, 0, input, ssM.length + ssX.length + ctX.length + pkX.length, X_WING_LABEL.length); | ||
| try { | ||
| MessageDigest sha3 = MessageDigest.getInstance("SHA3-256"); |
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.
@wangweij Shall I hardcode the SUN provider or leave it open for the implementation to find a suitable provider?
| /** | ||
| * The X-Wing parameters | ||
| * | ||
| * @since 26 |
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.
to be updated before merging
containing both raw seed + expanded private key
containing both raw seed + expanded private key
|
|
|
X-Wing's private key is the seed. Since |
|
Have you thought about generalizing this as QSF as described in https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hybrid-kems and https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-concrete-hybrid-kems? |
Done, this did remove some extra hoops I jumped through before.
I still need to take a closer look, but might be worth it. The question is, whether I should broaden the scope of this PR or keep it focussed on X-Wing, retrofitting a general API afterwards? |
I'm not sure. There are quite some competing composite or hybrid schemes proposed. Maybe we can wait and see. |
|
@overheadhunter this pull request can not be integrated into git checkout JDK-8360939
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
I took some time to think about the QSF framework. I do believe it is possible to add this as an intermediary class/interface layer between NamedKEM and X-Wing. However, as you already noted, it is currently unclear whether other hybrid KEMs will implement this framework and become relevant. I still think that retrofitting X-Wing with an QSF interface wouldn't be a great deal, so unless you want it today, I would suggest to postpone it and keep the scope of this issue focused just on X-Wing. |
|
@overheadhunter This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply issue a |
|
Sorry but I really cannot predict it. The ML-DSA part (RFC 9881) has been published but the ML-KEM part is still an I-D. It is our policy that we do not support I-Ds in a JDK release. |
This PR adds to SunJCE:
The variable names in the X-Wing implementation corresponds with those in the RFC draft, section 5. The tests are taken from appendix C.
This PR depends on #24969.
Warning
Don't merge yet. The RFC is still a draft. While the authors confirmed it is final, it is not yet published.
The PR is intended for early testing and review.
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26032/head:pull/26032$ git checkout pull/26032Update a local copy of the PR:
$ git checkout pull/26032$ git pull https://git.openjdk.org/jdk.git pull/26032/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 26032View PR using the GUI difftool:
$ git pr show -t 26032Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26032.diff