Conversation
tarcieri
added a commit
that referenced
this pull request
May 10, 2026
Uses the `MaybeBox` type added in #309 to offload large values onto the heap when the `alloc` feature of the crate has been enabled.
tarcieri
added a commit
that referenced
this pull request
May 10, 2026
Uses the `MaybeBox` type added in #309 to offload large values onto the heap when the `alloc` feature of the crate has been enabled.
tarcieri
added a commit
that referenced
this pull request
May 10, 2026
Uses the `MaybeBox` type added in #309 to offload large values onto the heap when the `alloc` feature of the crate has been enabled.
Merged
tarcieri
added a commit
that referenced
this pull request
May 10, 2026
## Added - `MaybeBox` type (#309)
tarcieri
added a commit
to RustCrypto/signatures
that referenced
this pull request
May 10, 2026
The `MaybeBox` type was moved to `module-lattice` so it could also be used with the `ml-kem` crate. See RustCrypto/KEMs#309
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.
Adds a type which is always available, but when the newly added
allocfeature is enabled, provides opportunistic heap allocation withBox, falling back on stack allocation if it is not.Originally added to the
ml-dsacrate in RustCrypto/signatures#1320 to address the large size of post-quantum keys and signatures while still retainingno_allocsupport.However, it is generally useful anywhere we work with secret values to e.g. prevent moves from making copies of them on the stack, even if they aren't excessively large.