-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add benchmark for ecdsa (#5113)
# Description ## Problem\* Related to noir-lang/zk_bench#11 ## Summary\* Add a benchmark test for noir ends, following PR 6566 (aztec-packages) ## Additional Context ## Documentation\* Check one: - [X] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist\* - [X] I have tested the changes locally. - [X] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings. --------- Co-authored-by: Tom French <[email protected]>
- Loading branch information
1 parent
dea6b32
commit 558d79e
Showing
3 changed files
with
182 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
test_programs/execution_success/bench_ecdsa_secp256k1/Nargo.toml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[package] | ||
name = "bench_ecdsa_secp256k1" | ||
description = "ECDSA secp256k1 verification" | ||
type = "bin" | ||
authors = [""] | ||
|
||
[dependencies] |
169 changes: 169 additions & 0 deletions
169
test_programs/execution_success/bench_ecdsa_secp256k1/Prover.toml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
|
||
hashed_message = [ | ||
0x3a, | ||
0x73, | ||
0xf4, | ||
0x12, | ||
0x3a, | ||
0x5c, | ||
0xd2, | ||
0x12, | ||
0x1f, | ||
0x21, | ||
0xcd, | ||
0x7e, | ||
0x8d, | ||
0x35, | ||
0x88, | ||
0x35, | ||
0x47, | ||
0x69, | ||
0x49, | ||
0xd0, | ||
0x35, | ||
0xd9, | ||
0xc2, | ||
0xda, | ||
0x68, | ||
0x06, | ||
0xb4, | ||
0x63, | ||
0x3a, | ||
0xc8, | ||
0xc1, | ||
0xe2, | ||
] | ||
pub_key_x = [ | ||
0xa0, | ||
0x43, | ||
0x4d, | ||
0x9e, | ||
0x47, | ||
0xf3, | ||
0xc8, | ||
0x62, | ||
0x35, | ||
0x47, | ||
0x7c, | ||
0x7b, | ||
0x1a, | ||
0xe6, | ||
0xae, | ||
0x5d, | ||
0x34, | ||
0x42, | ||
0xd4, | ||
0x9b, | ||
0x19, | ||
0x43, | ||
0xc2, | ||
0xb7, | ||
0x52, | ||
0xa6, | ||
0x8e, | ||
0x2a, | ||
0x47, | ||
0xe2, | ||
0x47, | ||
0xc7, | ||
] | ||
pub_key_y = [ | ||
0x89, | ||
0x3a, | ||
0xba, | ||
0x42, | ||
0x54, | ||
0x19, | ||
0xbc, | ||
0x27, | ||
0xa3, | ||
0xb6, | ||
0xc7, | ||
0xe6, | ||
0x93, | ||
0xa2, | ||
0x4c, | ||
0x69, | ||
0x6f, | ||
0x79, | ||
0x4c, | ||
0x2e, | ||
0xd8, | ||
0x77, | ||
0xa1, | ||
0x59, | ||
0x3c, | ||
0xbe, | ||
0xe5, | ||
0x3b, | ||
0x03, | ||
0x73, | ||
0x68, | ||
0xd7, | ||
] | ||
signature = [ | ||
0xe5, | ||
0x08, | ||
0x1c, | ||
0x80, | ||
0xab, | ||
0x42, | ||
0x7d, | ||
0xc3, | ||
0x70, | ||
0x34, | ||
0x6f, | ||
0x4a, | ||
0x0e, | ||
0x31, | ||
0xaa, | ||
0x2b, | ||
0xad, | ||
0x8d, | ||
0x97, | ||
0x98, | ||
0xc3, | ||
0x80, | ||
0x61, | ||
0xdb, | ||
0x9a, | ||
0xe5, | ||
0x5a, | ||
0x4e, | ||
0x8d, | ||
0xf4, | ||
0x54, | ||
0xfd, | ||
0x28, | ||
0x11, | ||
0x98, | ||
0x94, | ||
0x34, | ||
0x4e, | ||
0x71, | ||
0xb7, | ||
0x87, | ||
0x70, | ||
0xcc, | ||
0x93, | ||
0x1d, | ||
0x61, | ||
0xf4, | ||
0x80, | ||
0xec, | ||
0xbb, | ||
0x0b, | ||
0x89, | ||
0xd6, | ||
0xeb, | ||
0x69, | ||
0x69, | ||
0x01, | ||
0x61, | ||
0xe4, | ||
0x9a, | ||
0x71, | ||
0x5f, | ||
0xcd, | ||
0x55, | ||
] |
6 changes: 6 additions & 0 deletions
6
test_programs/execution_success/bench_ecdsa_secp256k1/src/main.nr
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
use dep::std; | ||
|
||
fn main(hashed_message: [u8; 32], pub_key_x: [u8; 32], pub_key_y: [u8; 32], signature: [u8; 64]) { | ||
let valid_signature = std::ecdsa_secp256k1::verify_signature(pub_key_x, pub_key_y, signature, hashed_message); | ||
assert(valid_signature); | ||
} |