From e34d06dfbfd2cc90462dd80b666d5277f841b60d Mon Sep 17 00:00:00 2001 From: Felix Conway Date: Wed, 30 Jul 2025 10:32:58 +0100 Subject: [PATCH] Remove conditional now that 0 not in generated test data Signed-off-by: Felix Conway --- scripts/generate_bignum_tests.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/scripts/generate_bignum_tests.py b/scripts/generate_bignum_tests.py index 8b948665c..6a5a96afd 100755 --- a/scripts/generate_bignum_tests.py +++ b/scripts/generate_bignum_tests.py @@ -236,14 +236,9 @@ class BignumGCD(BignumOperation): def __init__(self, val_a: str, val_b: str) -> None: super().__init__(val_a, val_b) - # If the value of B is 0 (null or 0 with 1 limb), then the value - # returned by mbedtls_mpi_gcd() will be A, which may be negative, - # however the Python function will always return a positive value, - # so this needs to be accounted for. - if self.int_b == 0: - self._result = self.int_a - else: - self._result = math.gcd(self.int_a, self.int_b) + # We always expect as postivite result as the test data + # does not contain zero. + self._result = math.gcd(self.int_a, self.int_b) def description_suffix(self) -> str: suffix = ": "