diff --git a/src/bignum.nr b/src/bignum.nr index b50a02b2..52002bd7 100644 --- a/src/bignum.nr +++ b/src/bignum.nr @@ -212,18 +212,17 @@ where unconstrained fn __batch_invert(x: [Self; M]) -> [Self; M] { let params = Params::get_params(); assert(params.has_multiplicative_inverse); - __batch_invert::<_, MOD_BITS, _>(params, x.map(|bn| Self::get_limbs_slice(bn).as_array())) - .map(|limbs| Self { limbs }) + __batch_invert::<_, MOD_BITS, _>(params, x.map(|bn: Self| bn.limbs)).map(|limbs| { + Self { limbs } + }) } unconstrained fn __batch_invert_slice(x: [Self]) -> [Self] { let params = Params::get_params(); assert(params.has_multiplicative_inverse); - __batch_invert_slice::<_, MOD_BITS>( - params, - x.map(|bn| Self::get_limbs_slice(bn).as_array()), - ) - .map(|limbs| Self { limbs }) + __batch_invert_slice::<_, MOD_BITS>(params, x.map(|bn: Self| bn.limbs)).map(|limbs| { + Self { limbs } + }) } unconstrained fn __tonelli_shanks_sqrt(self) -> std::option::Option { @@ -243,17 +242,11 @@ where let params = Params::get_params(); let (q_limbs, r_limbs) = __compute_quadratic_expression::<_, MOD_BITS, _, _, _, _>( params, - map( - lhs_terms, - |bns| map(bns, |bn| Self::get_limbs_slice(bn).as_array()), - ), + map(lhs_terms, |bns| map(bns, |bn: Self| bn.limbs)), lhs_flags, - map( - rhs_terms, - |bns| map(bns, |bn| Self::get_limbs_slice(bn).as_array()), - ), + map(rhs_terms, |bns| map(bns, |bn: Self| bn.limbs)), rhs_flags, - map(linear_terms, |bn| Self::get_limbs_slice(bn).as_array()), + map(linear_terms, |bn: Self| bn.limbs), linear_flags, ); (Self { limbs: q_limbs }, Self { limbs: r_limbs }) @@ -270,17 +263,11 @@ where let params = Params::get_params(); evaluate_quadratic_expression::<_, MOD_BITS, _, _, _, _>( params, - map( - lhs_terms, - |bns| map(bns, |bn| Self::get_limbs_slice(bn).as_array()), - ), + map(lhs_terms, |bns| map(bns, |bn: Self| bn.limbs)), lhs_flags, - map( - rhs_terms, - |bns| map(bns, |bn| Self::get_limbs_slice(bn).as_array()), - ), + map(rhs_terms, |bns| map(bns, |bn: Self| bn.limbs)), rhs_flags, - map(linear_terms, |bn| Self::get_limbs_slice(bn).as_array()), + map(linear_terms, |bn: Self| bn.limbs), linear_flags, ) }