-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand cases for generating a witness in prepare inputs (#452)
* preliminary debugging and testing * more preliminary debugging for prepare_inputs method * more debugging prints * add wnew witness for gadget inputs that are set based upon instructions * working evaluation when inputs to gadget are from aan if statement * clean up syntax and minor changes from PR review
- Loading branch information
Showing
4 changed files
with
27 additions
and
10 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
a = "1" | ||
pub_x = "0x0000000000000000000000000000000000000000000000000000000000000001" | ||
pub_y = "0x0000000000000002cf135e7506a45d632d270d45f1181294833fc48d823f272c" | ||
a_pub_x = "0x0000000000000000000000000000000000000000000000000000000000000001" | ||
a_pub_y = "0x0000000000000002cf135e7506a45d632d270d45f1181294833fc48d823f272c" | ||
|
||
b = "2" | ||
b_pub_x = "0x06ce1b0827aafa85ddeb49cdaa36306d19a74caa311e13d46d8bc688cdbffffe" | ||
b_pub_y = "0x1c122f81a3a14964909ede0ba2a6855fc93faf6fa1a788bf467be7e7a43f80ac" |
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 |
---|---|---|
@@ -1,7 +1,22 @@ | ||
use dep::std; | ||
|
||
fn main(a: Field, pub_x: pub Field, pub_y: pub Field) { | ||
let res = std::scalar_mul::fixed_base(a); | ||
fn main( | ||
a: Field, | ||
a_pub_x: pub Field, | ||
a_pub_y: pub Field, | ||
b: Field, | ||
b_pub_x: pub Field, | ||
b_pub_y: pub Field | ||
) { | ||
let mut priv_key = a; | ||
let mut pub_x: Field = a_pub_x; | ||
let mut pub_y: Field = a_pub_y; | ||
if a != 1 { // Change `a` in Prover.toml to test input `b` | ||
priv_key = b; | ||
pub_x = b_pub_x; | ||
pub_y = b_pub_y; | ||
} | ||
let res = std::scalar_mul::fixed_base(priv_key); | ||
constrain res[0] == pub_x; | ||
constrain res[1] == pub_y; | ||
} |
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
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