mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-10 13:09:24 +00:00
bulletproofs: avoid mut
This commit is contained in:
@@ -78,10 +78,8 @@ pub(crate) fn bit_decompose(commitments: &[Commitment]) -> (ScalarVector, Scalar
|
|||||||
|
|
||||||
for j in 0 .. M {
|
for j in 0 .. M {
|
||||||
for i in (0 .. N).rev() {
|
for i in (0 .. N).rev() {
|
||||||
let mut bit = Choice::from(0);
|
let bit =
|
||||||
if j < sv.len() {
|
if j < sv.len() { Choice::from((sv[j][i / 8] >> (i % 8)) & 1) } else { Choice::from(0) };
|
||||||
bit = Choice::from((sv[j][i / 8] >> (i % 8)) & 1);
|
|
||||||
}
|
|
||||||
aL.0[(j * N) + i] = Scalar::conditional_select(&Scalar::ZERO, &Scalar::ONE, bit);
|
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);
|
aR.0[(j * N) + i] = Scalar::conditional_select(&-Scalar::ONE, &Scalar::ZERO, bit);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user