mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-27 23:37:08 +00:00
Add test case generation for bignum add
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
This commit is contained in:
parent
69a92ce497
commit
86caf85ed2
@ -204,6 +204,27 @@ class BignumCmpAbs(BignumCmp):
|
||||
super().__init__(val_l.strip("-"), val_r.strip("-"))
|
||||
|
||||
|
||||
class BignumAdd(BignumOperation):
|
||||
"""Target for bignum addition test cases."""
|
||||
count = 0
|
||||
func = "mbedtls_mpi_add_mpi"
|
||||
title = "MPI add"
|
||||
input_cases = list(itertools.combinations(
|
||||
[
|
||||
"1c67967269c6", "9cde3",
|
||||
"-1c67967269c6", "-9cde3",
|
||||
], 2
|
||||
))
|
||||
|
||||
def __init__(self, val_l, val_r):
|
||||
super().__init__(val_l, val_r)
|
||||
self.symb = "+"
|
||||
|
||||
@property
|
||||
def result(self):
|
||||
return quote_str(hex(self.int_l + self.int_r).replace("0x", "", 1))
|
||||
|
||||
|
||||
class TestGenerator:
|
||||
"""Generate test data."""
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user