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: Add tests of more Pedersen iterations #17

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/pedersen_100/Nargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "pedersen_100"
type = "bin"
authors = [""]
compiler_version = ">=0.30.0"

[dependencies]
102 changes: 102 additions & 0 deletions tests/pedersen_100/Prover.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
input = [
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
[1,2],
]
204 changes: 204 additions & 0 deletions tests/pedersen_100/input.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
{
"in": [
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2",
"1",
"2"
]
}
20 changes: 20 additions & 0 deletions tests/pedersen_100/main.circom
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
pragma circom 2.0.0;

include "../../circomlib/pedersen.circom";

template Main(n) {
signal input in[2*n];
signal output out[2*n];
component pedersens[n];

for (var j=0; j<100; j++) {
pedersens[j] = Pedersen(2);

pedersens[j].in[0] <== in[2*j];
pedersens[j].in[1] <== in[2*j+1];
out[2*j] <== pedersens[j].out[0];
out[2*j+1] <== pedersens[j].out[1];
}
}

component main = Main(100);
12 changes: 12 additions & 0 deletions tests/pedersen_100/src/main.nr
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use dep::std::hash;

global iterations = 100;

fn main(input: [[Field; 2]; iterations]) -> pub [Field; iterations] {
let mut results: [Field; iterations] = [0; iterations];
for i in 0..iterations {
results[i] = hash::pedersen_hash(input[i]);
}

results
}
7 changes: 7 additions & 0 deletions tests/pedersen_1000/Nargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "pedersen_1000"
type = "bin"
authors = [""]
compiler_version = ">=0.30.0"

[dependencies]
Loading