Merged
Conversation
# Conflicts: # src/cryptography/hazmat/primitives/asymmetric/types.py # src/rust/cryptography-key-parsing/src/pkcs8.rs # src/rust/cryptography-key-parsing/src/spki.rs
alex
reviewed
Apr 8, 2026
This was referenced Apr 8, 2026
Merged
# Conflicts: # src/rust/cryptography-key-parsing/src/pkcs8.rs
DarkaMaul
commented
Apr 8, 2026
alex
reviewed
Apr 9, 2026
# Conflicts: # src/cryptography/hazmat/primitives/asymmetric/types.py
alex
reviewed
Apr 11, 2026
alex
previously approved these changes
Apr 14, 2026
Member
alex
left a comment
There was a problem hiding this comment.
handful of Qs + I'd like paul's review, but I think this is basically ready
| pub fn from_pkey<T: openssl::pkey::HasPublic>( | ||
| pkey: &openssl::pkey::PKeyRef<T>, | ||
| ) -> MlKemVariant { | ||
| // AWS-LC is missing the equivalent `EVP_PKEY_pqdsa_get_type`, so we |
Member
There was a problem hiding this comment.
Have we filed a bug to ask for it?
| ciphertext.len(), | ||
| ))?; | ||
| } | ||
| shared_secret.truncate(ss_len); |
Member
There was a problem hiding this comment.
Can ss_len ever not be equal to shared_secret.len()?
Contributor
Author
There was a problem hiding this comment.
I don't think so (source).
I've updated the code to use an assert like the encapsulate method instead.
reaperhulk
reviewed
Apr 15, 2026
| } | ||
|
|
||
| #[pyo3::pyfunction] | ||
| fn from_mlkem768_public_bytes(data: &[u8]) -> pyo3::PyResult<MlKem768PublicKey> { |
Member
There was a problem hiding this comment.
The python type stub documents this as taking Buffer so this arg should be a cffibuf or we need to change the signature.
Contributor
Author
There was a problem hiding this comment.
Fixed. I also opened #14667 to fix the mldsa side.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Member
|
ruff format needed |
reaperhulk
approved these changes
Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the support for ML-KEM using AWS-LC as the backend.
The PR is massive (sorry), about 1000 lines, but I could not reduce it more.
It follows closely the pattern of MLDSA, with the latest changes (class cases, variant enum)
A following PR with the documentation will be opened once this one get merged.
(Note: until aws/aws-lc#3140 is fixed, we have to store the ML-KEM seed on our side)