1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-28 00:21:48 +03:00

Bignum: Implement mbedtls_mpi_mod_raw_inv_prime() and tests

Fixes #6023.

Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
This commit is contained in:
Tom Cosgrove
2022-12-08 09:44:10 +00:00
parent a7f0d7b029
commit 6129268fee
6 changed files with 187 additions and 4 deletions

View File

@ -99,6 +99,7 @@ class OperationCommon(test_data_generation.BaseTest):
limb_sizes = [32, 64] # type: List[int]
arities = [1, 2]
arity = 2
suffix = False # for arity = 1, symbol can be prefix (default) or suffix
def __init__(self, val_a: str, val_b: str = "0", bits_in_limb: int = 32) -> None:
self.val_a = val_a
@ -170,7 +171,8 @@ class OperationCommon(test_data_generation.BaseTest):
"""
if not self.case_description:
if self.arity == 1:
self.case_description = "{} {:x}".format(
format_string = "{1:x} {0}" if self.suffix else "{0} {1:x}"
self.case_description = format_string.format(
self.symbol, self.int_a
)
elif self.arity == 2: