Implement mbedtls_mpi_mod_add()

Signed-off-by: Werner Lewis <werner.lewis@arm.com>
This commit is contained in:
Werner Lewis 2022-11-29 12:25:05 +00:00
parent 977c53f00a
commit e1b6b7c0ac
5 changed files with 184 additions and 1 deletions

View file

@ -55,6 +55,20 @@ class BignumModSub(bignum_common.ModOperationCommon, BignumModTarget):
# END MERGE SLOT 4
# BEGIN MERGE SLOT 5
class BignumModAdd(bignum_common.ModOperationCommon, BignumModTarget):
"""Test cases for bignum mpi_mod_add()."""
count = 0
symbol = "+"
test_function = "mpi_mod_add"
test_name = "mbedtls_mpi_mod_add"
input_style = "fixed"
def result(self) -> List[str]:
result = (self.int_a + self.int_b) % self.int_n
# To make negative tests easier, append "0" for success to the
# generated cases
return [self.format_result(result), "0"]
# END MERGE SLOT 5