Bignum: stop duplicating test function arguments for 32-bit vs 64-bit #6370
Labels
component-crypto
Crypto primitives and low-level interfaces
enhancement
priority-medium
Medium priority - this can be reviewed as time permits
size-m
Estimated task size: medium (~1w)
Some new bignum unit tests use functions that take arguments in pairs, with one argument used on 32-bit systems and one on 64-bit systems. This is useful because in some cases, the interesting inputs, or even some outputs such as carries, depend on the limb size. However, passing pairs of arguments in this way makes lists of test cases harder to read, complicates the test function code, and means that the same test case uses different data on different platforms.
The goal of this issue is to replace this idiom by one that does not involve passing different arguments depending on the limb size. Instead, if some test data is only valid for a given limb size, make the test case depend on
MBEDTLS_HAVE_INTnn
.The test data generation framework (
generate_bignum_tests.py
) is now available to generate pairs of similar test cases in a convenient, easy-to-review way.Definition of done: no more duplicated test arguments
A4/A8
, no more conditionals ondefined(MBEDTLS_HAVE_INTnn)
orsizeof(mbedtls_mpi_uint)
intest_suite_mpi*.function
.Follow-up: #6371
The text was updated successfully, but these errors were encountered: