GCD-modinv tests: adapt to new pre-condition

The function does not compute inverses mod 1

Signed-off-by: Manuel Pégourié-Gonnard <[email protected]>
This commit is contained in:
Manuel Pégourié-Gonnard
2025-07-28 23:43:50 +02:00
parent af84b28c9e
commit ead52d56b2
+3 -2
View File
@@ -947,8 +947,9 @@ class BignumCoreGcdModinvOdd(BignumCoreTarget, test_data_generation.BaseTest):
self.a_desc = a_desc
self.n_val = n
self.n_desc = n_desc
self.g_val = g = math.gcd(a, n)
self.i_val = bignum_common.invmod_positive(a, n) if g == 1 else None
self.g_val = math.gcd(a, n)
test_i = self.g_val == 1 and self.n_val != 1
self.i_val = bignum_common.invmod_positive(a, n) if test_i else None
def arguments(self) -> List[str]:
a_str = f"{self.a_val:x}"