@@ -10,41 +10,36 @@ use crate::{
1010
1111use  ark_bls12_377:: { constraints:: PairingVar  as  IV ,  Bls12_377  as  I ,  Fr } ; 
1212
13- use  ark_crypto_primitives:: { 
14-   snark:: BooleanInputVar ,  CircuitSpecificSetupSNARK ,  SNARKGadget ,  SNARK , 
15- } ; 
13+ use  ark_crypto_primitives:: snark:: { BooleanInputVar ,  SNARKGadget } ; 
14+ use  ark_snark:: { CircuitSpecificSetupSNARK ,  SNARK } ; 
1615
1716use  ark_ff:: { BitIteratorLE ,  PrimeField ,  Zero } ; 
1817use  ark_groth16:: { 
1918  constraints:: { Groth16VerifierGadget ,  PreparedVerifyingKeyVar ,  ProofVar } , 
2019  Groth16 ,  PreparedVerifyingKey ,  Proof  as  GrothProof , 
2120} ; 
2221
23- use  ark_poly_commit:: multilinear_pc:: data_structures:: Commitment ; 
22+ use  ark_crypto_primitives:: sponge:: { 
23+   constraints:: CryptographicSpongeVar , 
24+   poseidon:: { constraints:: PoseidonSpongeVar ,  PoseidonConfig } , 
25+ } ; 
26+ use  ark_poly_commit:: multilinear_pc:: data_structures:: { Commitment ,  Proof ,  VerifierKey } ; 
2427use  ark_r1cs_std:: { 
2528  alloc:: { AllocVar ,  AllocationMode } , 
2629  fields:: fp:: FpVar , 
2730  prelude:: { Boolean ,  EqGadget ,  FieldVar } , 
2831} ; 
2932use  ark_relations:: r1cs:: { ConstraintSynthesizer ,  ConstraintSystemRef ,  Namespace ,  SynthesisError } ; 
30- use  ark_sponge:: { 
31-   constraints:: CryptographicSpongeVar , 
32-   poseidon:: { constraints:: PoseidonSpongeVar ,  PoseidonParameters } , 
33- } ; 
3433use  rand:: { CryptoRng ,  Rng } ; 
3534
3635pub  struct  PoseidonTranscripVar  { 
3736  pub  cs :  ConstraintSystemRef < Fr > , 
3837  pub  sponge :  PoseidonSpongeVar < Fr > , 
39-   pub  params :  PoseidonParameters < Fr > , 
38+   pub  params :  PoseidonConfig < Fr > , 
4039} 
4140
4241impl  PoseidonTranscripVar  { 
43-   fn  new ( 
44-     cs :  ConstraintSystemRef < Fr > , 
45-     params :  & PoseidonParameters < Fr > , 
46-     challenge :  Option < Fr > , 
47-   )  -> Self  { 
42+   fn  new ( cs :  ConstraintSystemRef < Fr > ,  params :  & PoseidonConfig < Fr > ,  challenge :  Option < Fr > )  -> Self  { 
4843    let  mut  sponge = PoseidonSpongeVar :: new ( cs. clone ( ) ,  params) ; 
4944
5045    if  let  Some ( c)  = challenge { 
@@ -245,7 +240,7 @@ pub struct R1CSVerificationCircuit {
245240  pub  input :  Vec < Fr > , 
246241  pub  input_as_sparse_poly :  SparsePolynomial , 
247242  pub  evals :  ( Fr ,  Fr ,  Fr ) , 
248-   pub  params :  PoseidonParameters < Fr > , 
243+   pub  params :  PoseidonConfig < Fr > , 
249244  pub  prev_challenge :  Fr , 
250245  pub  claims_phase2 :  ( Scalar ,  Scalar ,  Scalar ,  Scalar ) , 
251246  pub  eval_vars_at_ry :  Fr , 
@@ -411,7 +406,7 @@ pub struct VerifierConfig {
411406  pub  input :  Vec < Fr > , 
412407  pub  input_as_sparse_poly :  SparsePolynomial , 
413408  pub  evals :  ( Fr ,  Fr ,  Fr ) , 
414-   pub  params :  PoseidonParameters < Fr > , 
409+   pub  params :  PoseidonConfig < Fr > , 
415410  pub  prev_challenge :  Fr , 
416411  pub  claims_phase2 :  ( Fr ,  Fr ,  Fr ,  Fr ) , 
417412  pub  eval_vars_at_ry :  Fr , 
@@ -464,7 +459,7 @@ impl ConstraintSynthesizer<Fq> for VerifierCircuit {
464459    let  bits = pubs
465460      . iter ( ) 
466461      . map ( |c| { 
467-         let  bits:  Vec < bool >  = BitIteratorLE :: new ( c. into_repr ( ) . as_ref ( ) . to_vec ( ) ) . collect ( ) ; 
462+         let  bits:  Vec < bool >  = BitIteratorLE :: new ( c. into_bigint ( ) . as_ref ( ) . to_vec ( ) ) . collect ( ) ; 
468463        Vec :: new_witness ( cs. clone ( ) ,  || Ok ( bits) ) 
469464      } ) 
470465      . collect :: < Result < Vec < _ > ,  _ > > ( ) ?; 
0 commit comments