Skip to content

Commit 566d360

Browse files
kashbrtiKhashayar Barooti
andauthored
feat: moved the hashing to poseidon lib instead of stdlib (#11)
Co-authored-by: Khashayar Barooti <[email protected]>
1 parent 4b1a7eb commit 566d360

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

.github/workflows/benchmark.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
run: |
2424
npm install -g bbup
2525
bbup -nv 0.36.0
26+
sudo apt install libc++-dev
27+
2628
2729
- name: Build Noir benchmark programs
2830
run: nargo export
@@ -34,7 +36,7 @@ jobs:
3436

3537
- name: Compare gates reports
3638
id: gates_diff
37-
uses: noir-lang/noir-gates-diff@1931aaaa848a1a009363d6115293f7b7fc72bb87
39+
uses: noir-lang/noir-gates-diff@dbe920a8dcc3370af4be4f702ca9cef29317bec1
3840
with:
3941
report: gates_report.json
4042
summaryQuantile: 0.9 # only display the 10% most significant circuit size diffs in the summary (defaults to 20%)

Nargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ compiler_version = ">=0.36.0"
66

77
[dependencies]
88
ec = { tag = "v0.1.2", git = "https://github.com/noir-lang/ec" }
9+
poseidon = { tag = "v0.1.0", git = "https://github.com/noir-lang/poseidon" }

src/lib.nr

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use poseidon;
12
use std::default::Default;
23
use std::hash::Hasher;
34

@@ -56,8 +57,8 @@ pub fn eddsa_to_pub(secret: Field) -> (Field, Field) {
5657
}
5758

5859
mod tests {
59-
use std::hash::poseidon::PoseidonHasher;
60-
use std::hash::poseidon2::Poseidon2Hasher;
60+
use poseidon::poseidon::PoseidonHasher;
61+
use poseidon::poseidon2::Poseidon2Hasher;
6162

6263
use ec::{consts::te::baby_jubjub, tecurve::affine::Point as TEPoint};
6364

@@ -128,7 +129,7 @@ fn bench_eddsa_poseidon(
128129
signature_r8_y: Field,
129130
message: Field,
130131
) -> bool {
131-
eddsa_verify::<std::hash::poseidon::PoseidonHasher>(
132+
eddsa_verify::<poseidon::poseidon::PoseidonHasher>(
132133
pub_key_x,
133134
pub_key_y,
134135
signature_s,

0 commit comments

Comments
 (0)