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
Added support for P-384 #41
Conversation
12c45a5
to
4abbde9
Compare
6222344
to
5ac1dec
Compare
Thanks for this! It'll take a little bit for me to get through this, so bear with me 🙏 |
I'll fix the CI issues on my side - very weird because locally there's no issue and I've been using my fork without issues (and everything passes test vectors and KATs) I'll get to it in the next few days |
This should now be much better - also rebased on top of the |
This looks great! One ask: could you possibly factor out the impls in |
Also massively refactored the NIST P-XXX key rejection sampling process to make it generic over the key length. This prepares the groundwork for when the `p521` crate will be ready for consumption.
…ors don't exist for P384
Oops I entirely didn't see your comment (dammit github notifications!) sorry! Let me know if you need anything! (On top of that I'll add x448 support next - with the help of the |
No worries, already done! Take a look at the changes I made and lmk if they look good. Once I figure out this faliing test, I'll merge. Re goldilocks: I'm not sure the crate is mature enough to expose to HPKE users. It appears to be barely maintained. |
Looks good, but I have one gripe: https://github.com/rozbb/rust-hpke/pull/41/files#diff-ca6f6f9186921533454b89e427f1a1e994ec9073010cd16555e79d043cae98a3R186 It seems you reverted to the previous derive_keypair algorithm and not the one I introduced: rozbb/rust-hpke@ This was one of the main points of my change beyond the p384 support; as the
The latest release is 10 days ago. It's slowly maintained but it seems to be. And sadly, it's pretty much the only ed448 implementation in the whole Rust ecosystem :( |
I refactored it to explicitly take in a Re goldilocks: the last commit before then was Dec. 2022. And before then Feb. 2022. If it becomes actively maintained in the near future then I'll reconsider, but for now it does not seem sufficiently supported for the intended users of this crate. |
You're right. I took a look at the spec and I have no idea why I was rejection sampling
Gotcha. Just so you know, my implementation lives here: https://github.com/OtaK/rust-hpke/blob/28bda9e3a148c46528c00ed745008ab01c500f0a/src/dhkex/x448.rs It's still untested as of now, but I'll get back to it when needed. |
Ah I see the confusion now. Thanks for the impl! If/when the crate matures I'll happily pull it in. Oh and I think I deleted all the P curve test vectors! Will fix later today |
Hi! I added support for p384.
There is a breaking change to be mindful of:
ecdh_nistp
toecdh_nistp::p256
But basically:
p521
crate will be ready for consumption.serde_derive
dev-dependency in favor of enabling the"derive"
feature onserde
Feel free to ask for any change!
NB: I also have a PR pending for X448 that depends on this PR.