From d225f526c7996db2dc94034e18208f3591ac36fc Mon Sep 17 00:00:00 2001 From: MozirDmitriy Date: Mon, 6 Oct 2025 11:34:26 +0300 Subject: [PATCH 1/2] Fix subgroup check in r-check branch for TE and SW --- src/groups/curves/short_weierstrass/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/groups/curves/short_weierstrass/mod.rs b/src/groups/curves/short_weierstrass/mod.rs index fbfa8e3..ad32bb9 100644 --- a/src/groups/curves/short_weierstrass/mod.rs +++ b/src/groups/curves/short_weierstrass/mod.rs @@ -900,7 +900,7 @@ where if cofactor_weight < modulus_minus_1_weight { Ok(result) } else { - ge.enforce_equal(&ge)?; + ge.negate()?.enforce_equal(&result)?; Ok(ge) } }, From 9feb668287d9a34a023eb7494a76b430b9bbf52d Mon Sep 17 00:00:00 2001 From: MozirDmitriy Date: Mon, 6 Oct 2025 11:34:54 +0300 Subject: [PATCH 2/2] Fix subgroup check in r-check branch for TE and SW --- src/groups/curves/twisted_edwards/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/groups/curves/twisted_edwards/mod.rs b/src/groups/curves/twisted_edwards/mod.rs index 83c50a0..1ceccc9 100644 --- a/src/groups/curves/twisted_edwards/mod.rs +++ b/src/groups/curves/twisted_edwards/mod.rs @@ -641,7 +641,7 @@ where if cofactor_weight < modulus_minus_1_weight { Ok(result) } else { - ge.enforce_equal(&ge)?; + ge.negate()?.enforce_equal(&result)?; Ok(ge) } },