@@ -200,9 +200,9 @@ pub fn create_oracle_with_public_input<F: FieldWitness>(
200200 use poly_commitment:: commitment:: shift_scalar;
201201
202202 // TODO: Don't clone the SRS here
203- let mut srs = ( * verifier_index. srs ) . clone ( ) ;
203+ let srs = ( * verifier_index. srs ) . clone ( ) ;
204204 let log_size_of_group = verifier_index. domain . log_size_of_group ;
205- let lgr_comm = make_lagrange :: < F > ( & mut srs, log_size_of_group) ;
205+ let lgr_comm = make_lagrange :: < F > ( & srs, log_size_of_group) ;
206206
207207 let lgr_comm: Vec < PolyComm < F :: OtherCurve > > =
208208 lgr_comm. into_iter ( ) . take ( public_input. len ( ) ) . collect ( ) ;
@@ -501,20 +501,21 @@ fn make_public_input(
501501 unfinalized_proofs. to_field_elements ( & mut fields) ;
502502 }
503503
504- let to_fp = |v : [ u64 ; 4 ] | Fp :: try_from ( BigInteger256 :: new ( v) ) . unwrap ( ) ; // Never fail, `messages_for_next_step_proof_hash` was a `Fp`
504+ let to_fp = |v : [ u64 ; 4 ] | Fp :: from ( BigInteger256 :: new ( v) ) ; // Never fail, `messages_for_next_step_proof_hash` was a `Fp`
505505 to_fp ( messages_for_next_step_proof_hash) . to_field_elements ( & mut fields) ;
506506
507507 // `messages_for_next_wrap_proof_hash` were `Fq` previously, so we have to
508508 // build a `Fp` from them with care: they can overflow
509509 let to_fp = |v : [ u64 ; 4 ] | {
510- match Fp :: try_from ( BigInteger256 :: new ( v) ) {
511- Ok ( fp) => fp, // fast-path: we get the `Fp` without modulo/reducing
512- Err ( _) => {
513- // slow path: we build the `Fp` bit by bit, so it will reduce it
514- let bits = crate :: proofs:: transaction:: bigint_to_bits :: < 255 > ( BigInteger256 :: new ( v) ) ;
515- super :: util:: field_of_bits ( & bits)
516- }
517- }
510+ // match Fp::try_from(BigInteger256::new(v)) {
511+ // Ok(fp) => fp, // fast-path: we get the `Fp` without modulo/reducing
512+ // Err(_) => {
513+ // // slow path: we build the `Fp` bit by bit, so it will reduce it
514+ // let bits = crate::proofs::transaction::bigint_to_bits::<255>(BigInteger256::new(v));
515+ // super::util::field_of_bits(&bits)
516+ // }
517+ // }
518+ Fp :: from ( BigInteger256 :: new ( v) )
518519 } ;
519520 for msg in messages_for_next_wrap_proof_hash. iter ( ) . copied ( ) . map ( to_fp) {
520521 msg. to_field_elements ( & mut fields) ;
@@ -687,7 +688,7 @@ pub fn wrap<C: ProofConstants + ForWrapData>(
687688 prover_index : step_prover_index,
688689 } ) ;
689690
690- let to_fq = |[ a, b] : [ u64 ; 2 ] | Fq :: try_from ( BigInteger256 :: new ( [ a, b, 0 , 0 ] ) ) . unwrap ( ) ; // Never fail with 2 limbs
691+ let to_fq = |[ a, b] : [ u64 ; 2 ] | Fq :: from ( BigInteger256 :: new ( [ a, b, 0 , 0 ] ) ) ; // Never fail with 2 limbs
691692 let to_fqs = |v : & [ [ u64 ; 2 ] ] | v. iter ( ) . copied ( ) . map ( to_fq) . collect :: < Vec < _ > > ( ) ;
692693
693694 let messages_for_next_wrap_proof = MessagesForNextWrapProof {
@@ -845,7 +846,7 @@ impl Check<Fq> for ShiftedValue<Fp> {
845846 let shifted: Fq = {
846847 let ShiftedValue { shifted } = self . clone ( ) ;
847848 let f: BigInteger256 = shifted. into ( ) ;
848- f. try_into ( ) . unwrap ( ) // Never fail, `Fq` is larger than `Fp`
849+ f. into ( ) // Never fail, `Fq` is larger than `Fp`
849850 } ;
850851 field:: equal ( shifted, forbidden, w)
851852 } ) ;
@@ -2178,7 +2179,7 @@ pub mod wrap_verifier {
21782179
21792180 let combined_inner_product: Fq = {
21802181 let bigint: BigInteger256 = advice. combined_inner_product . shifted . into ( ) ;
2181- bigint. try_into ( ) . unwrap ( ) // Never fail, `Fq` is larger than `Fp`
2182+ bigint. into ( ) // Never fail, `Fq` is larger than `Fp`
21822183 } ;
21832184 sponge. absorb ( & [ combined_inner_product] , w) ;
21842185
0 commit comments