Skip to content

Commit

Permalink
Enable noir eddsa test
Browse files Browse the repository at this point in the history
  • Loading branch information
guipublic committed Mar 29, 2024
1 parent f124445 commit d033fd9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ package-lock.json

# To use with nektos/act
.github/event.json
tests/eddsa/Verifier.toml
7 changes: 1 addition & 6 deletions src/suite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,7 @@ pub fn run() -> Result<(), String> {
.flatten()
.filter(|c| c.path().is_dir());
for test in tests {
let test_name = test.file_name();
if test_name.to_str().unwrap().contains("eddsa") {
benchme(test.path(), &mut circom)?;
//avoid eddsa noir because inputs are not valid...TODO
continue;
}
//let test_name = test.file_name();
benchme(test.path(), &mut circom)?;
benchme(test.path(), &mut noir)?;
}
Expand Down
12 changes: 6 additions & 6 deletions tests/eddsa/prover.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
msg = [1,2]
pub_key_x = 245
pub_key_y = 312
r8_x = 101
r8_y = 212
s = 400
msg = 789
pub_key_x = "0x16b051f37589e0dcf4ad3c415c090798c10d3095bedeedabfcc709ad787f3507"
pub_key_y = "0x062800ac9e60839fab9218e5ed9d541f4586e41275f4071816a975895d349a5e"
r8_x = "0x163814666f04c4d2969059a6b63ee26a0f9f0f81bd5957b0796e2e8f4a8a2f06"
r8_y = "0x1255b17d9e4bfb81831625b788f8a1665128079ac4b6c8c3cd1b857666a05a54"
s = "1230930278088778318663840827871215383007447616379808164955640681455510074924"
5 changes: 2 additions & 3 deletions tests/eddsa/src/main.nr
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ use dep::std::hash;
use dep::std::eddsa::{eddsa_poseidon_verify, eddsa_verify_with_hasher};
use dep::std::hash::pedersen::PedersenHasher;

fn main(msg: pub [Field;2], pub_key_x: Field, pub_key_y: Field, r8_x: Field, r8_y: Field, s: Field) -> pub bool {
fn main(msg: pub Field, pub_key_x: Field, pub_key_y: Field, r8_x: Field, r8_y: Field, s: Field) -> pub bool {
let mut hasher = PedersenHasher::default();
eddsa_verify_with_hasher(pub_key_x, pub_key_y, s, r8_x, r8_y, msg[0], &mut hasher)

eddsa_verify_with_hasher(pub_key_x, pub_key_y, s, r8_x, r8_y, msg, &mut hasher)
}

0 comments on commit d033fd9

Please sign in to comment.