-
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
[PQ] Add experimental support for HPKE #398
[PQ] Add experimental support for HPKE #398
Conversation
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.
Still have to cover cipher implementation and testing.
.gitmodules
Outdated
url = https://github.com/sgmenda-aws/aws-lc | ||
branch = experimental-pq-hybrid-with-hpke |
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.
What's the story here? Is this temporary? Will this branch exist in upstream AWS-LC? We can't be referencing submodules in personal forks.
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.
Yes, this is temporary till aws/aws-lc#1777 is merged.
build.gradle
Outdated
workingDir awslcSrcPath | ||
commandLine "git", "checkout", awsLcGitVersionId | ||
} | ||
// FIXME: Commented because it was breaking Github CI |
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.
What's going on here?
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.
Github does not support git checkout <branch>
in submodules. This is temporary till aws-lc merges the HPKE PR, once that's done, I'll add this back and replace the VersionId with a commit hash.
Sorry for not explicitly marking these temporary changes.
src/com/amazon/corretto/crypto/provider/AmazonCorrettoCryptoProvider.java
Outdated
Show resolved
Hide resolved
tst/com/amazon/corretto/crypto/provider/test/HpkeCipherTest.java
Outdated
Show resolved
Hide resolved
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 looking pretty good. Only pending items I see are the placeholder AWS-LC references and failing CI. If we can get the CI passing, I'll happily approve.
* for DECRYPT and UNWRAP | ||
* @param params the algorithm parameters, must be an instance of HpkeParameterSpec, and may not | ||
* be null. | ||
* @param random a source of randomness |
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.
...which we discard
Turns out Since The following commit fixes this issue, and the test now passes with |
Alright, just so I fully understand what's going on here. You understandably no longer have access to the original Github account so you pushed this fix to a separate fork/account? Since you're no longer with us and this work is largely complete. The sensible next step is to cherry-pick this last commit to the branch and see how it runs against the tests. If we like the results enough, I'm inclined to merge the work into the experimental branch as-is since it's already largely complete. We can come back in later to do the necessary work to integrate it into the main trunk. |
@geedo0 Precisely. I figured out the bug after so pushed a fix to my personal account. Yes, if this passes the tests, I was hoping you'd merge into the experimental branch. Alternatively, if you prefer, I could open a new PR, but it seems easier to apply this fix on top with
|
I've brought this to the team's attention and we are working on getting this PR integrated while being respectful of your personal time. The fact that we've locked you out of this account is problematic though. The idea we landed on is to have Amir fork your work and submit a new PR that includes your last change. We'll then test/review/iterate from there, but I've recommended that we simply bias towards merging it into the experimental branch as any further cleanup can be pulled into the greater effort of re-integrating this when the time comes. |
f0a8740
into
corretto:experimental-pq-hybrid
Description of changes:
Add experimental support for using AWS-LC HPKE as a
Cipher
using AWS-LC'shpke.h
:AlgorithmParameterSpec
HpkeParameterSpec
EvpKey
EvpHpkeKey
PublicKey
EvpHpkePublicKey
and newPrivateKey
EvpHpkePrivateKey
KeyPairGenerator
HpkeGen
which generates a HPKE key, backed by the nativehpke_gen.cpp
Cipher``HpkeCipher
, which performs single-shot HPKE encryption and decryption, backed by the nativehpke_cipher.cpp
.Call-outs:
HpkeCipher.java
contain the core java implementationhpke_gen.cpp
andhpke_cipher.cpp
contain the main cpp wrappersTesting:
Added
HpkeGenTest
andHpkeCipherTest
to test basic correctness.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.