aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Cosgrove <tom.cosgrove@arm.com>2022-12-05 15:47:40 +0000
committerTom Cosgrove <tom.cosgrove@arm.com>2022-12-05 15:47:40 +0000
commitf51f972d67e76c2e76c0a2cc6ed803a70ad429ed (patch)
tree3cb195ca872256bd69f08ae2d939b697b40bea81
parent62b20488f18904f5ed36cd2443e1236b449750de (diff)
downloadmbedtls-f51f972d67e76c2e76c0a2cc6ed803a70ad429ed.tar.gz
Apply review comments
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
-rw-r--r--scripts/mbedtls_dev/bignum_mod.py11
-rw-r--r--tests/suites/test_suite_bignum_mod.function14
2 files changed, 10 insertions, 15 deletions
diff --git a/scripts/mbedtls_dev/bignum_mod.py b/scripts/mbedtls_dev/bignum_mod.py
index 5f4e362b0..aa06fe863 100644
--- a/scripts/mbedtls_dev/bignum_mod.py
+++ b/scripts/mbedtls_dev/bignum_mod.py
@@ -42,16 +42,11 @@ class BignumModSub(bignum_common.ModOperationCommon, BignumModTarget):
input_style = "fixed"
arity = 2
- # To make negative tests easier, append 0 for success to the generated cases
- def arguments(self) -> List[str]:
- return [bignum_common.quote_str(n) for n in [self.arg_n,
- self.arg_a,
- self.arg_b]
- ] + self.result() + ["0"]
-
def result(self) -> List[str]:
result = (self.int_a - self.int_b) % self.int_n
- return [self.format_result(result)]
+ # To make negative tests easier, append 0 for success to the
+ # generated cases
+ return [self.format_result(result), "0"]
# END MERGE SLOT 3
diff --git a/tests/suites/test_suite_bignum_mod.function b/tests/suites/test_suite_bignum_mod.function
index abf6732b4..0d2e232f9 100644
--- a/tests/suites/test_suite_bignum_mod.function
+++ b/tests/suites/test_suite_bignum_mod.function
@@ -9,9 +9,9 @@
ASSERT_COMPARE( (a).p, (a).limbs * sizeof(mbedtls_mpi_uint), \
(b).p, (b).limbs * sizeof(mbedtls_mpi_uint) )
-int test_read_modulus( mbedtls_mpi_mod_modulus *m,
- mbedtls_mpi_mod_rep_selector int_rep,
- char *input )
+static int test_read_modulus( mbedtls_mpi_mod_modulus *m,
+ mbedtls_mpi_mod_rep_selector int_rep,
+ char *input )
{
mbedtls_mpi_uint *p = NULL;
size_t limbs;
@@ -23,10 +23,10 @@ int test_read_modulus( mbedtls_mpi_mod_modulus *m,
return( mbedtls_mpi_mod_modulus_setup( m, p, limbs, int_rep ) );
}
-int test_read_residue( mbedtls_mpi_mod_residue *r,
- const mbedtls_mpi_mod_modulus *m,
- char *input,
- int skip_limbs_and_value_checks )
+static int test_read_residue( mbedtls_mpi_mod_residue *r,
+ const mbedtls_mpi_mod_modulus *m,
+ char *input,
+ int skip_limbs_and_value_checks )
{
mbedtls_mpi_uint *p = NULL;
size_t limbs;