fix: use core::mem instead of std::mem in no_std zkvm precompile module#39
Open
sergey-melnychuk wants to merge 27 commits into
Open
fix: use core::mem instead of std::mem in no_std zkvm precompile module#39sergey-melnychuk wants to merge 27 commits into
core::mem instead of std::mem in no_std zkvm precompile module#39sergey-melnychuk wants to merge 27 commits into
Conversation
The zkvm precompile module compiles under a no_std target (SP1 zkvm), so std::mem is unavailable. Replace with core::mem which is always available regardless of std.
Author
|
Note: This branch is based on tag If this should be rebased onto a different base branch, please let me know and I'll update it. |
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.
The
zkvmmodule insrc/algorithms/rsa.rsis compiled only forcfg(all(target_os = "zkvm", target_vendor = "succinct")), which is ano_stdtarget. The module usedstd::mem::transmuteandstd::mem::size_of, causing build failures when thestdfeature is disabled (the typical setup for SP1 guest programs).Replace all five occurrences with their
core::memequivalents, which are always available regardless ofstd.Error before this fix
Reproduction
Add
rsa = { version = "0.9", default-features = false }to an SP1 guest program and runcargo prove build.