Closed
Conversation
Ideally we could get rid of the bespoke traits in `ml-kem` and replace them with traits from the `kem` crate. This PR rewrites the usage example to use the `KeyInit` trait for generating the seed and initializing a `DecapsulationKey`, as well as retrieving its associated encapsulator.
Member
Author
|
This is attempting to leverage the changes I've been discussing in RustCrypto/traits#1508 Opened it for discussion on the ergonomics as they're not particularly awesome yet |
tarcieri
commented
Oct 31, 2025
| //! kem::{Decapsulate, Encapsulate, KeyInit} | ||
| //! }; | ||
| //! | ||
| //! type DecapsulationKey = ml_kem::kem::DecapsulationKey<MlKem768Params>; |
Member
Author
There was a problem hiding this comment.
Perhaps we could put these type aliases together for people so they don't have to assemble them like this?
Suggested change
| //! type DecapsulationKey = ml_kem::kem::DecapsulationKey<MlKem768Params>; | |
| //! use ml_kem::ml_kem_768::DecapsulationKey; |
tarcieri
added a commit
that referenced
this pull request
Oct 31, 2025
Defines the following modules: - `ml_kem_512` - `ml_kem_768` - `ml_kem_1024` Each contains the `ParameterSet` definition for the given security level (re-exported at the toplevel) along with type aliases for [`DecapsulationKey`] and [`EncapsulationKey`]. The documentation has been updated to use such a type alias for `DecapsulationKey` as originally proposed in #161
Member
Author
|
Closing in favor of #162 |
tarcieri
added a commit
that referenced
this pull request
Nov 2, 2025
Defines the following modules: - `ml_kem_512` - `ml_kem_768` - `ml_kem_1024` Each contains the `ParameterSet` definition for the given security level (re-exported at the toplevel) along with type aliases for `DecapsulationKey` and `EncapsulationKey`. The documentation has been updated to use such a type alias for `DecapsulationKey` as originally proposed in #161
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.
Ideally we could get rid of the bespoke traits in
ml-kemand replace them with traits from thekemcrate.This PR rewrites the usage example to use the
KeyInittrait for generating the seed and initializing aDecapsulationKey, as well as retrieving its associated encapsulator.cc @rozbb