GCD-modinv tests: simplify arguments()

We no longer need zfill() as the test function has become less picky.

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 44a653c3c8
commit 09489a1a0a
+5 -9
View File
@@ -951,15 +951,11 @@ class BignumCoreGcdModinvOdd(BignumCoreTarget, test_data_generation.BaseTest):
self.i_val = i
def arguments(self) -> List[str]:
a_str = bignum_common.quote_str(f"{self.a_val:x}")
n_str = bignum_common.quote_str(f"{self.n_val:x}")
n_len = len(n_str) - 2 # quotes
g_str = bignum_common.quote_str(f"{self.g_val:x}".zfill(n_len))
if self.i_val != 0:
i_str = bignum_common.quote_str(f"{self.i_val:x}".zfill(n_len))
else:
i_str = bignum_common.quote_str("")
return [a_str, n_str, g_str, i_str]
a_str = f"{self.a_val:x}"
n_str = f"{self.n_val:x}"
g_str = f"{self.g_val:x}"
i_str = f"{self.i_val:x}" if self.i_val != 0 else ""
return [bignum_common.quote_str(s) for s in (a_str, n_str, g_str, i_str)]
def description(self) -> str:
return f"GCD-modinv, A = {self.a_desc}, N = {self.n_desc}"