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

chore: bump light-poseidon #7568

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/deny.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
- uses: EmbarkStudios/cargo-deny-action@8d73959fce1cdc8989f23fdf03bec6ae6a6576ef
with:
command: check all
command: check all
10 changes: 4 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions tooling/nargo_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,7 @@ sha3.workspace = true
iai = "0.1.1"
test-case.workspace = true
lazy_static.workspace = true
light-poseidon = "0.2.0"

ark-bn254-v04 = { package = "ark-bn254", version = "^0.4.0", default-features = false, features = [
"curve",
] }
ark-ff-v04 = { package = "ark-ff", version = "^0.4.0", default-features = false }
light-poseidon = "0.3.0"

[[bench]]
name = "criterion"
Expand Down
16 changes: 6 additions & 10 deletions tooling/nargo_cli/tests/stdlib-props.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
Err(e) => panic!("failed to compile program; brillig = {force_brillig}:\n{source}\n{e:?}"),
};

let pedandic_solving = true;
let blackbox_solver = bn254_blackbox_solver::Bn254BlackBoxSolver(pedandic_solving);
let pedantic_solving = true;
let blackbox_solver = bn254_blackbox_solver::Bn254BlackBoxSolver(pedantic_solving);
let foreign_call_executor = RefCell::new(DefaultForeignCallBuilder::default().build());

// Generate multiple input/output
Expand Down Expand Up @@ -290,17 +290,13 @@

#[test]
fn fuzz_poseidon_equivalence() {
use ark_ff_v04::{BigInteger, PrimeField};
use light_poseidon::{Poseidon, PoseidonHasher};

let poseidon_hash = |inputs: &[FieldElement]| {
let mut poseidon = Poseidon::<ark_bn254_v04::Fr>::new_circom(inputs.len()).unwrap();
let frs: Vec<ark_bn254_v04::Fr> = inputs
.iter()
.map(|f| ark_bn254_v04::Fr::from_be_bytes_mod_order(&f.to_be_bytes()))
.collect::<Vec<_>>();
let hash = poseidon.hash(&frs).expect("failed to hash");
FieldElement::from_be_bytes_reduce(&hash.into_bigint().to_bytes_be())
let mut poseidon = Poseidon::<ark_bn254::Fr>::new_circom(inputs.len()).unwrap();

Check warning on line 296 in tooling/nargo_cli/tests/stdlib-props.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (circom)
let frs: Vec<ark_bn254::Fr> = inputs.iter().map(|f| f.into_repr()).collect::<Vec<_>>();
let hash: ark_bn254::Fr = poseidon.hash(&frs).expect("failed to hash");
FieldElement::from_repr(hash)
};

// Noir has hashes up to length 16, but the reference library won't work with more than 12.
Expand Down
Loading