mirror of
https://github.com/saymrwulf/pasta_curves-source.git
synced 2026-09-05 20:10:32 +00:00
Remove unnecessary identity check from Group::random impl
Co-authored-by: ebfull <ewillbefull@gmail.com>
This commit is contained in:
parent
62e50ae6bd
commit
5e05845936
1 changed files with 0 additions and 6 deletions
|
|
@ -65,12 +65,6 @@ macro_rules! new_curve_impl {
|
||||||
let x = $base::random(&mut rng);
|
let x = $base::random(&mut rng);
|
||||||
let ysign = (rng.next_u32() % 2) as u8;
|
let ysign = (rng.next_u32() % 2) as u8;
|
||||||
|
|
||||||
if x.is_zero() && ysign == 0 {
|
|
||||||
// This would be the identity if encoded, and Group::random must
|
|
||||||
// sample from the non-identity elements of the group.
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
let x3 = x.square() * x;
|
let x3 = x.square() * x;
|
||||||
let y = (x3 + $name::curve_constant_b()).sqrt();
|
let y = (x3 + $name::curve_constant_b()).sqrt();
|
||||||
if let Some(y) = Option::<$base>::from(y) {
|
if let Some(y) = Option::<$base>::from(y) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue