mirror of
https://github.com/Mbed-TLS/mbedtls-framework.git
synced 2026-10-16 21:57:23 +00:00
Remove conditional now that 0 not in generated test data
Signed-off-by: Felix Conway <[email protected]>
This commit is contained in:
@@ -236,14 +236,9 @@ class BignumGCD(BignumOperation):
|
|||||||
|
|
||||||
def __init__(self, val_a: str, val_b: str) -> None:
|
def __init__(self, val_a: str, val_b: str) -> None:
|
||||||
super().__init__(val_a, val_b)
|
super().__init__(val_a, val_b)
|
||||||
# If the value of B is 0 (null or 0 with 1 limb), then the value
|
# We always expect as postivite result as the test data
|
||||||
# returned by mbedtls_mpi_gcd() will be A, which may be negative,
|
# does not contain zero.
|
||||||
# however the Python function will always return a positive value,
|
self._result = math.gcd(self.int_a, self.int_b)
|
||||||
# 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)
|
|
||||||
|
|
||||||
def description_suffix(self) -> str:
|
def description_suffix(self) -> str:
|
||||||
suffix = ": "
|
suffix = ": "
|
||||||
|
|||||||
Reference in New Issue
Block a user