-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR adds in a number of new benchmark programs.
- Loading branch information
1 parent
1230e56
commit edb6db6
Showing
26 changed files
with
468 additions
and
9 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
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
7 changes: 7 additions & 0 deletions
7
noir/noir-repo/test_programs/benchmarks/bench_eddsa_poseidon/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_eddsa_poseidon" | ||
version = "0.1.0" | ||
type = "bin" | ||
authors = [""] | ||
|
||
[dependencies] |
6 changes: 6 additions & 0 deletions
6
noir/noir-repo/test_programs/benchmarks/bench_eddsa_poseidon/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,6 @@ | ||
msg = 789 | ||
pub_key_x = "0x16b051f37589e0dcf4ad3c415c090798c10d3095bedeedabfcc709ad787f3507" | ||
pub_key_y = "0x062800ac9e60839fab9218e5ed9d541f4586e41275f4071816a975895d349a5e" | ||
r8_x = "0x163814666f04c4d2969059a6b63ee26a0f9f0f81bd5957b0796e2e8f4a8a2f06" | ||
r8_y = "0x1255b17d9e4bfb81831625b788f8a1665128079ac4b6c8c3cd1b857666a05a54" | ||
s = "1230930278088778318663840827871215383007447616379808164955640681455510074924" |
12 changes: 12 additions & 0 deletions
12
noir/noir-repo/test_programs/benchmarks/bench_eddsa_poseidon/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,12 @@ | ||
use dep::std::eddsa::{eddsa_poseidon_verify}; | ||
|
||
fn main( | ||
msg: pub Field, | ||
pub_key_x: Field, | ||
pub_key_y: Field, | ||
r8_x: Field, | ||
r8_y: Field, | ||
s: Field | ||
) -> pub bool { | ||
eddsa_poseidon_verify(pub_key_x, pub_key_y, s, r8_x, r8_y, msg) | ||
} |
7 changes: 7 additions & 0 deletions
7
noir/noir-repo/test_programs/benchmarks/bench_poseidon_hash/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_poseidon_hash" | ||
version = "0.1.0" | ||
type = "bin" | ||
authors = [""] | ||
|
||
[dependencies] |
1 change: 1 addition & 0 deletions
1
noir/noir-repo/test_programs/benchmarks/bench_poseidon_hash/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 @@ | ||
input = [1,2] |
5 changes: 5 additions & 0 deletions
5
noir/noir-repo/test_programs/benchmarks/bench_poseidon_hash/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,5 @@ | ||
use dep::std::hash::poseidon; | ||
|
||
fn main(input: [Field; 2]) -> pub Field { | ||
poseidon::bn254::hash_2(input) | ||
} |
7 changes: 7 additions & 0 deletions
7
noir/noir-repo/test_programs/benchmarks/bench_poseidon_hash_100/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_poseidon_hash_100" | ||
version = "0.1.0" | ||
type = "bin" | ||
authors = [""] | ||
|
||
[dependencies] |
102 changes: 102 additions & 0 deletions
102
noir/noir-repo/test_programs/benchmarks/bench_poseidon_hash_100/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,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], | ||
] |
12 changes: 12 additions & 0 deletions
12
noir/noir-repo/test_programs/benchmarks/bench_poseidon_hash_100/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,12 @@ | ||
use dep::std::hash; | ||
|
||
global SIZE = 100; | ||
|
||
fn main(input: [[Field; 2]; SIZE]) -> pub [Field; SIZE] { | ||
let mut results: [Field; SIZE] = [0; SIZE]; | ||
for i in 0..SIZE { | ||
results[i] = hash::poseidon::bn254::hash_2(input[i]); | ||
} | ||
|
||
results | ||
} |
7 changes: 7 additions & 0 deletions
7
noir/noir-repo/test_programs/benchmarks/bench_poseidon_hash_30/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_poseidon_hash_30" | ||
version = "0.1.0" | ||
type = "bin" | ||
authors = [""] | ||
|
||
[dependencies] |
32 changes: 32 additions & 0 deletions
32
noir/noir-repo/test_programs/benchmarks/bench_poseidon_hash_30/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,32 @@ | ||
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], | ||
] |
12 changes: 12 additions & 0 deletions
12
noir/noir-repo/test_programs/benchmarks/bench_poseidon_hash_30/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,12 @@ | ||
use dep::std::hash; | ||
|
||
global SIZE = 30; | ||
|
||
fn main(input: [[Field; 2]; SIZE]) -> pub [Field; SIZE] { | ||
let mut results: [Field; SIZE] = [0; SIZE]; | ||
for i in 0..SIZE { | ||
results[i] = hash::poseidon::bn254::hash_2(input[i]); | ||
} | ||
|
||
results | ||
} |
7 changes: 7 additions & 0 deletions
7
noir/noir-repo/test_programs/benchmarks/bench_sha256/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_sha256" | ||
version = "0.1.0" | ||
type = "bin" | ||
authors = [""] | ||
|
||
[dependencies] |
1 change: 1 addition & 0 deletions
1
noir/noir-repo/test_programs/benchmarks/bench_sha256/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 @@ | ||
input = [1,2] |
5 changes: 5 additions & 0 deletions
5
noir/noir-repo/test_programs/benchmarks/bench_sha256/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,5 @@ | ||
use dep::std; | ||
|
||
fn main(input: [u8; 2]) -> pub [u8; 32] { | ||
std::hash::sha256(input) | ||
} |
7 changes: 7 additions & 0 deletions
7
noir/noir-repo/test_programs/benchmarks/bench_sha256_100/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_sha256_100" | ||
version = "0.1.0" | ||
type = "bin" | ||
authors = [""] | ||
|
||
[dependencies] |
Oops, something went wrong.