ml-dsa: activate MaybeBox with alloc feature#1370
Closed
baloo wants to merge 1 commit into
Closed
Conversation
When the matrices were pushed on the stack in RustCrypto#1344 and RustCrypto#1345, it relies on the `MaybeBox` implementation of `module-lattice`. `MaybeBox` will push the matrix on the heap only if `alloc` is enabled. Because `alloc` never got activated in `ml-dsa` this effectively reverted the optimization on the stack size made in RustCrypto#1261 and RustCrypto#1259. This commit fixes that by enabling `alloc` on `module-lattice` when `alloc` is enabled on `ml-dsa` and restoring the expected behavior of `MaybeBox`.
Member
Author
|
a workaround for a consumer crate until this makes into a release is to enable the feature on |
Member
|
This looks like a dup of #1365? I think if you rebase on |
Member
Author
|
indeed, sorry for the noise. |
Member
|
I can cut a patch release with the fix |
Member
Author
|
I think we can use the workaround, if you have time that'd be appreciated, but it's fine otherwise. |
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.
When the matrices were pushed on the stack in #1344 and #1345, it relies on the
MaybeBoximplementation ofmodule-lattice.MaybeBoxwill push the matrix on the heap only ifallocis enabled.Because
allocnever got activated inml-dsathis effectively reverted the optimization on the stack size made in #1261 and #1259.This commit fixes that by enabling
alloconmodule-latticewhenallocis enabled onml-dsaand restoring the expected behavior ofMaybeBox.