diff --git a/Cargo.lock b/Cargo.lock index f4a518ac..46d7ef93 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1169,9 +1169,9 @@ dependencies = [ [[package]] name = "sm3" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f943a7c5e3089f2bd046221d1e9f4fa59396bf0fe966360983649683086215da" +checksum = "ebb9a3b702d0a7e33bc4d85a14456633d2b165c2ad839c5fd9a8417c1ab15860" dependencies = [ "digest", ] diff --git a/primeorder/src/affine.rs b/primeorder/src/affine.rs index e7f2fecc..3fb01d90 100644 --- a/primeorder/src/affine.rs +++ b/primeorder/src/affine.rs @@ -182,8 +182,11 @@ where } sec1::Coordinates::Uncompressed { x, y } => { C::FieldElement::from_repr(*y).and_then(|y| { - Self::decompress(x, y.is_odd()) - .and_then(|point| CtOption::new(point, point.y.ct_eq(&y))) + C::FieldElement::from_repr(*x).and_then(|x| { + let lhs = y * &y; + let rhs = x * &x * &x + &(C::EQUATION_A * &x) + &C::EQUATION_B; + CtOption::new(Self { x, y, infinity: 0 }, lhs.ct_eq(&rhs)) + }) }) } }