-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ssa refactor): schnorr signature handling (#1727)
* fix(ssa refactor): schnorr inputs * chore(ssa refactor): cp working test
- Loading branch information
1 parent
a1596bc
commit 98ecf93
Showing
4 changed files
with
27 additions
and
3 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
crates/nargo_cli/tests/test_data_ssa_refactor/schnorr/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,5 @@ | ||
[package] | ||
authors = [""] | ||
compiler_version = "0.1" | ||
|
||
[dependencies] |
9 changes: 9 additions & 0 deletions
9
crates/nargo_cli/tests/test_data_ssa_refactor/schnorr/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,9 @@ | ||
message = [0,1,2,3,4,5,6,7,8,9] | ||
pub_key_x = "0x17cbd3ed3151ccfd170efe1d54280a6a4822640bf5c369908ad74ea21518a9c5" | ||
pub_key_y = "0x0e0456e3795c1a31f20035b741cd6158929eeccd320d299cfcac962865a6bc74" | ||
signature = [ | ||
5, 202, 31, 146, 81, 242, 246, 69, 43, 107, 249, 153, 198, 44, 14, 111, 191, 121, 137, 166, | ||
160, 103, 18, 181, 243, 233, 226, 95, 67, 16, 37, 128, 85, 76, 19, 253, 30, 77, 192, 53, 138, | ||
205, 69, 33, 236, 163, 83, 194, 84, 137, 184, 221, 176, 121, 179, 27, 63, 70, 54, 16, 176, | ||
250, 39, 239, | ||
] |
10 changes: 10 additions & 0 deletions
10
crates/nargo_cli/tests/test_data_ssa_refactor/schnorr/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,10 @@ | ||
use dep::std; | ||
|
||
// Note: If main has any unsized types, then the verifier will never be able | ||
// to figure out the circuit instance | ||
fn main(message: [u8; 10], pub_key_x: Field, pub_key_y: Field, signature: [u8; 64]) { | ||
// Is there ever a situation where someone would want | ||
// to ensure that a signature was invalid? | ||
let valid_signature = std::schnorr::verify_signature(pub_key_x,pub_key_y,signature, message); | ||
assert(valid_signature); | ||
} |
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