Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
iAmMichaelConnor committed Nov 14, 2024
1 parent 9a46a06 commit 8cb9df6
Showing 1 changed file with 10 additions and 23 deletions.
33 changes: 10 additions & 23 deletions src/bignum.nr
Original file line number Diff line number Diff line change
Expand Up @@ -212,18 +212,17 @@ where
unconstrained fn __batch_invert<let M: u32>(x: [Self; M]) -> [Self; M] {
let params = Params::get_params();
assert(params.has_multiplicative_inverse);
__batch_invert::<_, MOD_BITS, _>(params, x.map(|bn: Self| bn.limbs))
.map(|limbs| Self { limbs })
__batch_invert::<_, MOD_BITS, _>(params, x.map(|bn: Self| bn.limbs)).map(|limbs| {
Self { limbs }
})
}

unconstrained fn __batch_invert_slice<let M: u32>(x: [Self]) -> [Self] {
let params = Params::get_params();
assert(params.has_multiplicative_inverse);
__batch_invert_slice::<_, MOD_BITS>(
params,
x.map(|bn: Self| bn.limbs),
)
.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<Self> {
Expand All @@ -243,15 +242,9 @@ 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| bn.limbs),
),
map(lhs_terms, |bns| map(bns, |bn: Self| bn.limbs)),
lhs_flags,
map(
rhs_terms,
|bns| map(bns, |bn: Self| bn.limbs),
),
map(rhs_terms, |bns| map(bns, |bn: Self| bn.limbs)),
rhs_flags,
map(linear_terms, |bn: Self| bn.limbs),
linear_flags,
Expand All @@ -270,15 +263,9 @@ where
let params = Params::get_params();
evaluate_quadratic_expression::<_, MOD_BITS, _, _, _, _>(
params,
map(
lhs_terms,
|bns| map(bns, |bn: Self| bn.limbs),
),
map(lhs_terms, |bns| map(bns, |bn: Self| bn.limbs)),
lhs_flags,
map(
rhs_terms,
|bns| map(bns, |bn: Self| bn.limbs),
),
map(rhs_terms, |bns| map(bns, |bn: Self| bn.limbs)),
rhs_flags,
map(linear_terms, |bn: Self| bn.limbs),
linear_flags,
Expand Down

0 comments on commit 8cb9df6

Please sign in to comment.