Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: vm.publicKeyP256 #8679

Merged
merged 7 commits into from
Aug 15, 2024
Merged

feat: vm.publicKeyP256 #8679

merged 7 commits into from
Aug 15, 2024

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Aug 15, 2024

Motivation

Closes #7908

Adds cheatcode for deriving public key for P256 private key

Solution

crates/cheatcodes/spec/src/vm.rs Outdated Show resolved Hide resolved
crates/cheatcodes/src/crypto.rs Show resolved Hide resolved
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, pending doc nit

@klkvr klkvr enabled auto-merge (squash) August 15, 2024 19:27
@klkvr klkvr disabled auto-merge August 15, 2024 19:30
Co-authored-by: protocolwhisper <chrismata10@gmail.com>
@klkvr klkvr merged commit 62def0d into master Aug 15, 2024
21 checks passed
@klkvr klkvr deleted the klkvr/public-key-p256 branch August 15, 2024 19:48
klkvr added a commit that referenced this pull request Aug 16, 2024
* publicKeyP256

* clippy

* fix error

* update doc

* update error message

* add coauthor

Co-authored-by: protocolwhisper <chrismata10@gmail.com>

---------

Co-authored-by: protocolwhisper <chrismata10@gmail.com>
@pcaversaccio
Copy link
Contributor

Can you please add the function to the vm interface in forge-std, otherwise hard to use 🙃

pcaversaccio added a commit to pcaversaccio/snekmate that referenced this pull request Aug 27, 2024
### 🕓 Changelog

The Foundry PR [#8679](foundry-rs/foundry#8679)
and `forge-std` PR
[#596](foundry-rs/forge-std#596) introduced a
native `publicKey256` cheat code to derive the public key coordinates
based on the `secp256r1` curve from a random `uint256` private key. As a
result, I refactor the `p256` test and remove the now redundant
[`FreshCryptoLib`](https://github.com/rdubois-crypto/FreshCryptoLib)
submodule from the codebase.

---------
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
benwjhack pushed a commit to CompassLabs/foundry-test that referenced this pull request Sep 11, 2024
* publicKeyP256

* clippy

* fix error

* update doc

* update error message

* add coauthor

Co-authored-by: protocolwhisper <chrismata10@gmail.com>

---------

Co-authored-by: protocolwhisper <chrismata10@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(cheatcodes): P256 public key generator
4 participants