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:
Luke Parker
2022-08-13 19:43:18 -04:00
parent 062cd77a98
commit 75c3cdc5af
2 changed files with 21 additions and 11 deletions

View File

@@ -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()