mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Comment the previous commit
Despite the intentions of https://github.com/serai-dex/serai/issues/85, it failed to be practically faster :/ Updates a DLEq test to be better as well.
This commit is contained in:
@@ -2,7 +2,7 @@ use rand_core::{RngCore, CryptoRng};
|
||||
|
||||
use zeroize::Zeroize;
|
||||
|
||||
use ff::{Field, PrimeField, PrimeFieldBits};
|
||||
use ff::{Field, PrimeFieldBits};
|
||||
use group::Group;
|
||||
|
||||
use crate::{multiexp, multiexp_vartime};
|
||||
@@ -32,6 +32,12 @@ where
|
||||
} else {
|
||||
let mut weight;
|
||||
while {
|
||||
// Generate a random scalar
|
||||
weight = G::Scalar::random(&mut *rng);
|
||||
|
||||
// Clears half the bits, maintaining security, to minimize scalar additions
|
||||
// Is not practically faster for whatever reason
|
||||
/*
|
||||
// Generate a random scalar
|
||||
let mut repr = G::Scalar::random(&mut *rng).to_repr();
|
||||
|
||||
@@ -55,6 +61,7 @@ where
|
||||
repr.as_mut().reverse();
|
||||
weight = G::Scalar::from_repr(repr).unwrap();
|
||||
}
|
||||
*/
|
||||
|
||||
// Ensure it's non-zero, as a zero scalar would cause this item to pass no matter what
|
||||
weight.is_zero().into()
|
||||
|
||||
Reference in New Issue
Block a user