mirror of
https://github.com/serai-dex/serai.git
synced 2024-11-17 01:17:36 +00:00
bulletproofs: avoid mut
This commit is contained in:
parent
5c047ebe74
commit
a6947d6d21
1 changed files with 2 additions and 4 deletions
|
@ -78,10 +78,8 @@ pub(crate) fn bit_decompose(commitments: &[Commitment]) -> (ScalarVector, Scalar
|
|||
|
||||
for j in 0 .. M {
|
||||
for i in (0 .. N).rev() {
|
||||
let mut bit = Choice::from(0);
|
||||
if j < sv.len() {
|
||||
bit = Choice::from((sv[j][i / 8] >> (i % 8)) & 1);
|
||||
}
|
||||
let bit =
|
||||
if j < sv.len() { Choice::from((sv[j][i / 8] >> (i % 8)) & 1) } else { Choice::from(0) };
|
||||
aL.0[(j * N) + i] = Scalar::conditional_select(&Scalar::ZERO, &Scalar::ONE, bit);
|
||||
aR.0[(j * N) + i] = Scalar::conditional_select(&-Scalar::ONE, &Scalar::ZERO, bit);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue