From 2a8bcf8c6fe64099bdd274b0b2aa2c7af2f81fc4 Mon Sep 17 00:00:00 2001 From: Janos Follath Date: Wed, 2 Nov 2022 10:47:30 +0000 Subject: [PATCH 01/10] Add bignum merge scaffolding Signed-off-by: Janos Follath --- library/bignum_core.c | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/library/bignum_core.c b/library/bignum_core.c index b990a8dcc..34aecda50 100644 --- a/library/bignum_core.c +++ b/library/bignum_core.c @@ -553,7 +553,6 @@ void mbedtls_mpi_core_ct_uint_table_lookup( mbedtls_mpi_uint *dest, } } - /* Fill X with n_bytes random bytes. * X must already have room for those bytes. * The ordering of the bytes returned from the RNG is suitable for @@ -581,4 +580,44 @@ cleanup: return( ret ); } +/* BEGIN MERGE SLOT 1 */ + +/* END MERGE SLOT 1 */ + +/* BEGIN MERGE SLOT 2 */ + +/* END MERGE SLOT 2 */ + +/* BEGIN MERGE SLOT 3 */ + +/* END MERGE SLOT 3 */ + +/* BEGIN MERGE SLOT 4 */ + +/* END MERGE SLOT 4 */ + +/* BEGIN MERGE SLOT 5 */ + +/* END MERGE SLOT 5 */ + +/* BEGIN MERGE SLOT 6 */ + +/* END MERGE SLOT 6 */ + +/* BEGIN MERGE SLOT 7 */ + +/* END MERGE SLOT 7 */ + +/* BEGIN MERGE SLOT 8 */ + +/* END MERGE SLOT 8 */ + +/* BEGIN MERGE SLOT 9 */ + +/* END MERGE SLOT 9 */ + +/* BEGIN MERGE SLOT 10 */ + +/* END MERGE SLOT 10 */ + #endif /* MBEDTLS_BIGNUM_C */ From 5933f691a24125b95e9d1d086694e87953490a09 Mon Sep 17 00:00:00 2001 From: Janos Follath Date: Wed, 2 Nov 2022 14:35:17 +0000 Subject: [PATCH 02/10] Add merge slots to Bignum files Legacy Bignum is excluded as it doesn't get regular extensions like new ones. Each slot uses comments of their respective filetype. Since .data files don't have a syntax for comments, dummy test cases are used. (These test cases will never be executed and no noise will be added to tests.) Signed-off-by: Janos Follath --- library/bignum_core.h | 40 ++++++++++ library/bignum_mod.c | 40 ++++++++++ library/bignum_mod.h | 40 ++++++++++ library/bignum_mod_raw.c | 40 ++++++++++ library/bignum_mod_raw.h | 40 ++++++++++ scripts/mbedtls_dev/bignum_core.py | 41 ++++++++++ tests/suites/test_suite_bignum_core.function | 40 ++++++++++ tests/suites/test_suite_bignum_core.misc.data | 80 +++++++++++++++++++ tests/suites/test_suite_bignum_mod.data | 80 +++++++++++++++++++ tests/suites/test_suite_bignum_mod.function | 40 ++++++++++ tests/suites/test_suite_bignum_mod_raw.data | 80 +++++++++++++++++++ .../suites/test_suite_bignum_mod_raw.function | 40 ++++++++++ 12 files changed, 601 insertions(+) diff --git a/library/bignum_core.h b/library/bignum_core.h index 624eaf49a..ad04e0828 100644 --- a/library/bignum_core.h +++ b/library/bignum_core.h @@ -494,4 +494,44 @@ int mbedtls_mpi_core_fill_random( mbedtls_mpi_uint *X, size_t X_limbs, int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ); +/* BEGIN MERGE SLOT 1 */ + +/* END MERGE SLOT 1 */ + +/* BEGIN MERGE SLOT 2 */ + +/* END MERGE SLOT 2 */ + +/* BEGIN MERGE SLOT 3 */ + +/* END MERGE SLOT 3 */ + +/* BEGIN MERGE SLOT 4 */ + +/* END MERGE SLOT 4 */ + +/* BEGIN MERGE SLOT 5 */ + +/* END MERGE SLOT 5 */ + +/* BEGIN MERGE SLOT 6 */ + +/* END MERGE SLOT 6 */ + +/* BEGIN MERGE SLOT 7 */ + +/* END MERGE SLOT 7 */ + +/* BEGIN MERGE SLOT 8 */ + +/* END MERGE SLOT 8 */ + +/* BEGIN MERGE SLOT 9 */ + +/* END MERGE SLOT 9 */ + +/* BEGIN MERGE SLOT 10 */ + +/* END MERGE SLOT 10 */ + #endif /* MBEDTLS_BIGNUM_CORE_H */ diff --git a/library/bignum_mod.c b/library/bignum_mod.c index 60c073ac4..13108c51f 100644 --- a/library/bignum_mod.c +++ b/library/bignum_mod.c @@ -184,4 +184,44 @@ exit: return( ret ); } +/* BEGIN MERGE SLOT 1 */ + +/* END MERGE SLOT 1 */ + +/* BEGIN MERGE SLOT 2 */ + +/* END MERGE SLOT 2 */ + +/* BEGIN MERGE SLOT 3 */ + +/* END MERGE SLOT 3 */ + +/* BEGIN MERGE SLOT 4 */ + +/* END MERGE SLOT 4 */ + +/* BEGIN MERGE SLOT 5 */ + +/* END MERGE SLOT 5 */ + +/* BEGIN MERGE SLOT 6 */ + +/* END MERGE SLOT 6 */ + +/* BEGIN MERGE SLOT 7 */ + +/* END MERGE SLOT 7 */ + +/* BEGIN MERGE SLOT 8 */ + +/* END MERGE SLOT 8 */ + +/* BEGIN MERGE SLOT 9 */ + +/* END MERGE SLOT 9 */ + +/* BEGIN MERGE SLOT 10 */ + +/* END MERGE SLOT 10 */ + #endif /* MBEDTLS_BIGNUM_C */ diff --git a/library/bignum_mod.h b/library/bignum_mod.h index 3b3338c2d..29c26f2ef 100644 --- a/library/bignum_mod.h +++ b/library/bignum_mod.h @@ -148,4 +148,44 @@ int mbedtls_mpi_mod_modulus_setup( mbedtls_mpi_mod_modulus *m, */ void mbedtls_mpi_mod_modulus_free( mbedtls_mpi_mod_modulus *m ); +/* BEGIN MERGE SLOT 1 */ + +/* END MERGE SLOT 1 */ + +/* BEGIN MERGE SLOT 2 */ + +/* END MERGE SLOT 2 */ + +/* BEGIN MERGE SLOT 3 */ + +/* END MERGE SLOT 3 */ + +/* BEGIN MERGE SLOT 4 */ + +/* END MERGE SLOT 4 */ + +/* BEGIN MERGE SLOT 5 */ + +/* END MERGE SLOT 5 */ + +/* BEGIN MERGE SLOT 6 */ + +/* END MERGE SLOT 6 */ + +/* BEGIN MERGE SLOT 7 */ + +/* END MERGE SLOT 7 */ + +/* BEGIN MERGE SLOT 8 */ + +/* END MERGE SLOT 8 */ + +/* BEGIN MERGE SLOT 9 */ + +/* END MERGE SLOT 9 */ + +/* BEGIN MERGE SLOT 10 */ + +/* END MERGE SLOT 10 */ + #endif /* MBEDTLS_BIGNUM_MOD_H */ diff --git a/library/bignum_mod_raw.c b/library/bignum_mod_raw.c index 4b8a69800..a329e86df 100644 --- a/library/bignum_mod_raw.c +++ b/library/bignum_mod_raw.c @@ -102,4 +102,44 @@ int mbedtls_mpi_mod_raw_write( const mbedtls_mpi_uint *A, } } +/* BEGIN MERGE SLOT 1 */ + +/* END MERGE SLOT 1 */ + +/* BEGIN MERGE SLOT 2 */ + +/* END MERGE SLOT 2 */ + +/* BEGIN MERGE SLOT 3 */ + +/* END MERGE SLOT 3 */ + +/* BEGIN MERGE SLOT 4 */ + +/* END MERGE SLOT 4 */ + +/* BEGIN MERGE SLOT 5 */ + +/* END MERGE SLOT 5 */ + +/* BEGIN MERGE SLOT 6 */ + +/* END MERGE SLOT 6 */ + +/* BEGIN MERGE SLOT 7 */ + +/* END MERGE SLOT 7 */ + +/* BEGIN MERGE SLOT 8 */ + +/* END MERGE SLOT 8 */ + +/* BEGIN MERGE SLOT 9 */ + +/* END MERGE SLOT 9 */ + +/* BEGIN MERGE SLOT 10 */ + +/* END MERGE SLOT 10 */ + #endif /* MBEDTLS_BIGNUM_C */ diff --git a/library/bignum_mod_raw.h b/library/bignum_mod_raw.h index 6f8f1559c..30648d3cc 100644 --- a/library/bignum_mod_raw.h +++ b/library/bignum_mod_raw.h @@ -138,4 +138,44 @@ int mbedtls_mpi_mod_raw_write( const mbedtls_mpi_uint *A, unsigned char *output, size_t output_length ); +/* BEGIN MERGE SLOT 1 */ + +/* END MERGE SLOT 1 */ + +/* BEGIN MERGE SLOT 2 */ + +/* END MERGE SLOT 2 */ + +/* BEGIN MERGE SLOT 3 */ + +/* END MERGE SLOT 3 */ + +/* BEGIN MERGE SLOT 4 */ + +/* END MERGE SLOT 4 */ + +/* BEGIN MERGE SLOT 5 */ + +/* END MERGE SLOT 5 */ + +/* BEGIN MERGE SLOT 6 */ + +/* END MERGE SLOT 6 */ + +/* BEGIN MERGE SLOT 7 */ + +/* END MERGE SLOT 7 */ + +/* BEGIN MERGE SLOT 8 */ + +/* END MERGE SLOT 8 */ + +/* BEGIN MERGE SLOT 9 */ + +/* END MERGE SLOT 9 */ + +/* BEGIN MERGE SLOT 10 */ + +/* END MERGE SLOT 10 */ + #endif /* MBEDTLS_BIGNUM_MOD_RAW_H */ diff --git a/scripts/mbedtls_dev/bignum_core.py b/scripts/mbedtls_dev/bignum_core.py index 9929e13fa..87098075f 100644 --- a/scripts/mbedtls_dev/bignum_core.py +++ b/scripts/mbedtls_dev/bignum_core.py @@ -815,3 +815,44 @@ def mpi_modmul_case_generate() -> None: ) i += 1 print(generated_inputs) + +# BEGIN MERGE SLOT 1 + +# END MERGE SLOT 1 + +# BEGIN MERGE SLOT 2 + +# END MERGE SLOT 2 + +# BEGIN MERGE SLOT 3 + +# END MERGE SLOT 3 + +# BEGIN MERGE SLOT 4 + +# END MERGE SLOT 4 + +# BEGIN MERGE SLOT 5 + +# END MERGE SLOT 5 + +# BEGIN MERGE SLOT 6 + +# END MERGE SLOT 6 + +# BEGIN MERGE SLOT 7 + +# END MERGE SLOT 7 + +# BEGIN MERGE SLOT 8 + +# END MERGE SLOT 8 + +# BEGIN MERGE SLOT 9 + +# END MERGE SLOT 9 + +# BEGIN MERGE SLOT 10 + +# END MERGE SLOT 10 + diff --git a/tests/suites/test_suite_bignum_core.function b/tests/suites/test_suite_bignum_core.function index 745a8af46..f50fd07e4 100644 --- a/tests/suites/test_suite_bignum_core.function +++ b/tests/suites/test_suite_bignum_core.function @@ -1045,3 +1045,43 @@ exit: mbedtls_free( X ); } /* END_CASE */ + +/* BEGIN MERGE SLOT 1 */ + +/* END MERGE SLOT 1 */ + +/* BEGIN MERGE SLOT 2 */ + +/* END MERGE SLOT 2 */ + +/* BEGIN MERGE SLOT 3 */ + +/* END MERGE SLOT 3 */ + +/* BEGIN MERGE SLOT 4 */ + +/* END MERGE SLOT 4 */ + +/* BEGIN MERGE SLOT 5 */ + +/* END MERGE SLOT 5 */ + +/* BEGIN MERGE SLOT 6 */ + +/* END MERGE SLOT 6 */ + +/* BEGIN MERGE SLOT 7 */ + +/* END MERGE SLOT 7 */ + +/* BEGIN MERGE SLOT 8 */ + +/* END MERGE SLOT 8 */ + +/* BEGIN MERGE SLOT 9 */ + +/* END MERGE SLOT 9 */ + +/* BEGIN MERGE SLOT 10 */ + +/* END MERGE SLOT 10 */ diff --git a/tests/suites/test_suite_bignum_core.misc.data b/tests/suites/test_suite_bignum_core.misc.data index 743bb3efe..28de24392 100644 --- a/tests/suites/test_suite_bignum_core.misc.data +++ b/tests/suites/test_suite_bignum_core.misc.data @@ -430,3 +430,83 @@ mpi_core_fill_random:42:0:-1:0:MBEDTLS_ERR_MPI_BAD_INPUT_DATA Fill random core: 42 bytes, 5 missing limbs mpi_core_fill_random:42:0:-5:0:MBEDTLS_ERR_MPI_BAD_INPUT_DATA + +BEGIN MERGE SLOT 1 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_core_io_null + +END MERGE SLOT 1 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_core_io_null + +BEGIN MERGE SLOT 2 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_core_io_null + +END MERGE SLOT 2 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_core_io_null + +BEGIN MERGE SLOT 3 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_core_io_null + +END MERGE SLOT 3 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_core_io_null + +BEGIN MERGE SLOT 4 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_core_io_null + +END MERGE SLOT 4 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_core_io_null + +BEGIN MERGE SLOT 5 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_core_io_null + +END MERGE SLOT 5 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_core_io_null + +BEGIN MERGE SLOT 6 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_core_io_null + +END MERGE SLOT 6 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_core_io_null + +BEGIN MERGE SLOT 7 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_core_io_null + +END MERGE SLOT 7 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_core_io_null + +BEGIN MERGE SLOT 8 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_core_io_null + +END MERGE SLOT 8 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_core_io_null + +BEGIN MERGE SLOT 9 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_core_io_null + +END MERGE SLOT 9 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_core_io_null + +BEGIN MERGE SLOT 10 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_core_io_null + +END MERGE SLOT 10 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_core_io_null diff --git a/tests/suites/test_suite_bignum_mod.data b/tests/suites/test_suite_bignum_mod.data index cb781403d..c80bfa338 100644 --- a/tests/suites/test_suite_bignum_mod.data +++ b/tests/suites/test_suite_bignum_mod.data @@ -24,3 +24,83 @@ mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_OPT_RED:0 Test mbedtls_mpi_mod_setup #9 (Both representations valid) mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 + +BEGIN MERGE SLOT 1 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 + +END MERGE SLOT 1 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 + +BEGIN MERGE SLOT 2 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 + +END MERGE SLOT 2 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 + +BEGIN MERGE SLOT 3 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 + +END MERGE SLOT 3 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 + +BEGIN MERGE SLOT 4 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 + +END MERGE SLOT 4 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 + +BEGIN MERGE SLOT 5 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 + +END MERGE SLOT 5 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 + +BEGIN MERGE SLOT 6 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 + +END MERGE SLOT 6 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 + +BEGIN MERGE SLOT 7 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 + +END MERGE SLOT 7 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 + +BEGIN MERGE SLOT 8 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 + +END MERGE SLOT 8 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 + +BEGIN MERGE SLOT 9 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 + +END MERGE SLOT 9 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 + +BEGIN MERGE SLOT 10 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 + +END MERGE SLOT 10 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 diff --git a/tests/suites/test_suite_bignum_mod.function b/tests/suites/test_suite_bignum_mod.function index ad89bdf3e..1a2d0c135 100644 --- a/tests/suites/test_suite_bignum_mod.function +++ b/tests/suites/test_suite_bignum_mod.function @@ -54,3 +54,43 @@ exit: #undef MLIMBS } /* END_CASE */ + +/* BEGIN MERGE SLOT 1 */ + +/* END MERGE SLOT 1 */ + +/* BEGIN MERGE SLOT 2 */ + +/* END MERGE SLOT 2 */ + +/* BEGIN MERGE SLOT 3 */ + +/* END MERGE SLOT 3 */ + +/* BEGIN MERGE SLOT 4 */ + +/* END MERGE SLOT 4 */ + +/* BEGIN MERGE SLOT 5 */ + +/* END MERGE SLOT 5 */ + +/* BEGIN MERGE SLOT 6 */ + +/* END MERGE SLOT 6 */ + +/* BEGIN MERGE SLOT 7 */ + +/* END MERGE SLOT 7 */ + +/* BEGIN MERGE SLOT 8 */ + +/* END MERGE SLOT 8 */ + +/* BEGIN MERGE SLOT 9 */ + +/* END MERGE SLOT 9 */ + +/* BEGIN MERGE SLOT 10 */ + +/* END MERGE SLOT 10 */ diff --git a/tests/suites/test_suite_bignum_mod_raw.data b/tests/suites/test_suite_bignum_mod_raw.data index 788165d1a..c47d47396 100644 --- a/tests/suites/test_suite_bignum_mod_raw.data +++ b/tests/suites/test_suite_bignum_mod_raw.data @@ -178,3 +178,83 @@ mpi_mod_raw_cond_swap:"000000001111111122222222333333334444444455555555666666667 mbedtls_mpi_mod_raw_cond_swap: copy half of the limbs mpi_mod_raw_cond_swap:"00000000FFFFFFFF55555555AAAAAAAA":"FEDCBA9876543210FEDCBA9876543210":8 + +BEGIN MERGE SLOT 1 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 + +END MERGE SLOT 1 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 + +BEGIN MERGE SLOT 2 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 + +END MERGE SLOT 2 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 + +BEGIN MERGE SLOT 3 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 + +END MERGE SLOT 3 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 + +BEGIN MERGE SLOT 4 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 + +END MERGE SLOT 4 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 + +BEGIN MERGE SLOT 5 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 + +END MERGE SLOT 5 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 + +BEGIN MERGE SLOT 6 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 + +END MERGE SLOT 6 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 + +BEGIN MERGE SLOT 7 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 + +END MERGE SLOT 7 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 + +BEGIN MERGE SLOT 8 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 + +END MERGE SLOT 8 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 + +BEGIN MERGE SLOT 9 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 + +END MERGE SLOT 9 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 + +BEGIN MERGE SLOT 10 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 + +END MERGE SLOT 10 +depends_on:MBEDTLS_BIGNUM_MERGE +mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 diff --git a/tests/suites/test_suite_bignum_mod_raw.function b/tests/suites/test_suite_bignum_mod_raw.function index 7c9d5dbe4..a6361d7e0 100644 --- a/tests/suites/test_suite_bignum_mod_raw.function +++ b/tests/suites/test_suite_bignum_mod_raw.function @@ -279,4 +279,44 @@ exit: mbedtls_mpi_mod_modulus_free( &m ); mbedtls_free( buff_m ); } + +/* BEGIN MERGE SLOT 1 */ + +/* END MERGE SLOT 1 */ + +/* BEGIN MERGE SLOT 2 */ + +/* END MERGE SLOT 2 */ + +/* BEGIN MERGE SLOT 3 */ + +/* END MERGE SLOT 3 */ + +/* BEGIN MERGE SLOT 4 */ + +/* END MERGE SLOT 4 */ + +/* BEGIN MERGE SLOT 5 */ + +/* END MERGE SLOT 5 */ + +/* BEGIN MERGE SLOT 6 */ + +/* END MERGE SLOT 6 */ + +/* BEGIN MERGE SLOT 7 */ + +/* END MERGE SLOT 7 */ + +/* BEGIN MERGE SLOT 8 */ + +/* END MERGE SLOT 8 */ + +/* BEGIN MERGE SLOT 9 */ + +/* END MERGE SLOT 9 */ + +/* BEGIN MERGE SLOT 10 */ + +/* END MERGE SLOT 10 */ /* END_CASE */ From df8239b846b2f61b59751071c402f5d6b626abb1 Mon Sep 17 00:00:00 2001 From: Janos Follath Date: Wed, 2 Nov 2022 14:40:58 +0000 Subject: [PATCH 03/10] Add script for generating mod_raw test cases This commit only adds the boilerplate, no actual tests are added. Signed-off-by: Janos Follath --- scripts/mbedtls_dev/bignum_mod_raw.py | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 scripts/mbedtls_dev/bignum_mod_raw.py diff --git a/scripts/mbedtls_dev/bignum_mod_raw.py b/scripts/mbedtls_dev/bignum_mod_raw.py new file mode 100644 index 000000000..767073171 --- /dev/null +++ b/scripts/mbedtls_dev/bignum_mod_raw.py @@ -0,0 +1,29 @@ +"""Framework classes for generation of bignum mod_raw test cases.""" +# Copyright The Mbed TLS Contributors +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import random + +from abc import ABCMeta +from typing import Dict, Iterator, List, Tuple + +from . import test_data_generation +from . import bignum_common + +class BignumCoreTarget(test_data_generation.BaseTarget, metaclass=ABCMeta): + #pylint: disable=abstract-method + """Target for bignum mod_raw test case generation.""" + target_basename = 'test_suite_bignum_mod_raw.generated' + From b99b056f0af8c07db063987a75b96ee65bd0975f Mon Sep 17 00:00:00 2001 From: Janos Follath Date: Wed, 2 Nov 2022 14:44:08 +0000 Subject: [PATCH 04/10] Add script for generating mod test cases This commit only adds the boilerplate, no actual tests are added. Signed-off-by: Janos Follath --- scripts/mbedtls_dev/bignum_mod.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 scripts/mbedtls_dev/bignum_mod.py diff --git a/scripts/mbedtls_dev/bignum_mod.py b/scripts/mbedtls_dev/bignum_mod.py new file mode 100644 index 000000000..3bed853c6 --- /dev/null +++ b/scripts/mbedtls_dev/bignum_mod.py @@ -0,0 +1,29 @@ +"""Framework classes for generation of bignum mod test cases.""" +# Copyright The Mbed TLS Contributors +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import random + +from abc import ABCMeta +from typing import Dict, Iterator, List, Tuple + +from . import test_data_generation +from . import bignum_common + +class BignumCoreTarget(test_data_generation.BaseTarget, metaclass=ABCMeta): + #pylint: disable=abstract-method + """Target for bignum mod test case generation.""" + target_basename = 'test_suite_bignum_mod.generated' + From 1be322a79569e8d7c56c24f7880919f7dc37d93e Mon Sep 17 00:00:00 2001 From: Janos Follath Date: Wed, 2 Nov 2022 14:46:23 +0000 Subject: [PATCH 05/10] Add merge slots to raw and mod_raw test generation Signed-off-by: Janos Follath --- scripts/mbedtls_dev/bignum_mod.py | 40 +++++++++++++++++++++++++++ scripts/mbedtls_dev/bignum_mod_raw.py | 40 +++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) diff --git a/scripts/mbedtls_dev/bignum_mod.py b/scripts/mbedtls_dev/bignum_mod.py index 3bed853c6..f4f05912f 100644 --- a/scripts/mbedtls_dev/bignum_mod.py +++ b/scripts/mbedtls_dev/bignum_mod.py @@ -27,3 +27,43 @@ class BignumCoreTarget(test_data_generation.BaseTarget, metaclass=ABCMeta): """Target for bignum mod test case generation.""" target_basename = 'test_suite_bignum_mod.generated' +# BEGIN MERGE SLOT 1 + +# END MERGE SLOT 1 + +# BEGIN MERGE SLOT 2 + +# END MERGE SLOT 2 + +# BEGIN MERGE SLOT 3 + +# END MERGE SLOT 3 + +# BEGIN MERGE SLOT 4 + +# END MERGE SLOT 4 + +# BEGIN MERGE SLOT 5 + +# END MERGE SLOT 5 + +# BEGIN MERGE SLOT 6 + +# END MERGE SLOT 6 + +# BEGIN MERGE SLOT 7 + +# END MERGE SLOT 7 + +# BEGIN MERGE SLOT 8 + +# END MERGE SLOT 8 + +# BEGIN MERGE SLOT 9 + +# END MERGE SLOT 9 + +# BEGIN MERGE SLOT 10 + +# END MERGE SLOT 10 + diff --git a/scripts/mbedtls_dev/bignum_mod_raw.py b/scripts/mbedtls_dev/bignum_mod_raw.py index 767073171..d5d48fe32 100644 --- a/scripts/mbedtls_dev/bignum_mod_raw.py +++ b/scripts/mbedtls_dev/bignum_mod_raw.py @@ -27,3 +27,43 @@ class BignumCoreTarget(test_data_generation.BaseTarget, metaclass=ABCMeta): """Target for bignum mod_raw test case generation.""" target_basename = 'test_suite_bignum_mod_raw.generated' +# BEGIN MERGE SLOT 1 + +# END MERGE SLOT 1 + +# BEGIN MERGE SLOT 2 + +# END MERGE SLOT 2 + +# BEGIN MERGE SLOT 3 + +# END MERGE SLOT 3 + +# BEGIN MERGE SLOT 4 + +# END MERGE SLOT 4 + +# BEGIN MERGE SLOT 5 + +# END MERGE SLOT 5 + +# BEGIN MERGE SLOT 6 + +# END MERGE SLOT 6 + +# BEGIN MERGE SLOT 7 + +# END MERGE SLOT 7 + +# BEGIN MERGE SLOT 8 + +# END MERGE SLOT 8 + +# BEGIN MERGE SLOT 9 + +# END MERGE SLOT 9 + +# BEGIN MERGE SLOT 10 + +# END MERGE SLOT 10 + From be136522961081c83b9e129c80e81dbee25e9690 Mon Sep 17 00:00:00 2001 From: Janos Follath Date: Wed, 2 Nov 2022 15:12:04 +0000 Subject: [PATCH 06/10] Use comments for merge separators in .data files We do have a comment syntax for .data files, there is no need for dummy test cases. Signed-off-by: Janos Follath --- tests/suites/test_suite_bignum_core.misc.data | 80 +++++------------- tests/suites/test_suite_bignum_mod.data | 81 +++++-------------- tests/suites/test_suite_bignum_mod_raw.data | 81 +++++-------------- 3 files changed, 62 insertions(+), 180 deletions(-) diff --git a/tests/suites/test_suite_bignum_core.misc.data b/tests/suites/test_suite_bignum_core.misc.data index 28de24392..30c767c74 100644 --- a/tests/suites/test_suite_bignum_core.misc.data +++ b/tests/suites/test_suite_bignum_core.misc.data @@ -431,82 +431,42 @@ mpi_core_fill_random:42:0:-1:0:MBEDTLS_ERR_MPI_BAD_INPUT_DATA Fill random core: 42 bytes, 5 missing limbs mpi_core_fill_random:42:0:-5:0:MBEDTLS_ERR_MPI_BAD_INPUT_DATA -BEGIN MERGE SLOT 1 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_core_io_null +# BEGIN MERGE SLOT 1 -END MERGE SLOT 1 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_core_io_null +# END MERGE SLOT 1 -BEGIN MERGE SLOT 2 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_core_io_null +# BEGIN MERGE SLOT 2 -END MERGE SLOT 2 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_core_io_null +# END MERGE SLOT 2 -BEGIN MERGE SLOT 3 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_core_io_null +# BEGIN MERGE SLOT 3 -END MERGE SLOT 3 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_core_io_null +# END MERGE SLOT 3 -BEGIN MERGE SLOT 4 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_core_io_null +# BEGIN MERGE SLOT 4 -END MERGE SLOT 4 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_core_io_null +# END MERGE SLOT 4 -BEGIN MERGE SLOT 5 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_core_io_null +# BEGIN MERGE SLOT 5 -END MERGE SLOT 5 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_core_io_null +# END MERGE SLOT 5 -BEGIN MERGE SLOT 6 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_core_io_null +# BEGIN MERGE SLOT 6 -END MERGE SLOT 6 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_core_io_null +# END MERGE SLOT 6 -BEGIN MERGE SLOT 7 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_core_io_null +# BEGIN MERGE SLOT 7 -END MERGE SLOT 7 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_core_io_null +# END MERGE SLOT 7 -BEGIN MERGE SLOT 8 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_core_io_null +# BEGIN MERGE SLOT 8 -END MERGE SLOT 8 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_core_io_null +# END MERGE SLOT 8 -BEGIN MERGE SLOT 9 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_core_io_null +# BEGIN MERGE SLOT 9 -END MERGE SLOT 9 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_core_io_null +# END MERGE SLOT 9 -BEGIN MERGE SLOT 10 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_core_io_null +# BEGIN MERGE SLOT 10 -END MERGE SLOT 10 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_core_io_null +# END MERGE SLOT 10 diff --git a/tests/suites/test_suite_bignum_mod.data b/tests/suites/test_suite_bignum_mod.data index c80bfa338..d06541fd6 100644 --- a/tests/suites/test_suite_bignum_mod.data +++ b/tests/suites/test_suite_bignum_mod.data @@ -25,82 +25,43 @@ mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_OPT_RED:0 Test mbedtls_mpi_mod_setup #9 (Both representations valid) mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 -BEGIN MERGE SLOT 1 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 +# BEGIN MERGE SLOT 1 -END MERGE SLOT 1 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 +# END MERGE SLOT 1 -BEGIN MERGE SLOT 2 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 +# BEGIN MERGE SLOT 2 -END MERGE SLOT 2 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 +# END MERGE SLOT 2 -BEGIN MERGE SLOT 3 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 +# BEGIN MERGE SLOT 3 -END MERGE SLOT 3 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 +# END MERGE SLOT 3 -BEGIN MERGE SLOT 4 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 +# BEGIN MERGE SLOT 4 -END MERGE SLOT 4 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 +# END MERGE SLOT 4 -BEGIN MERGE SLOT 5 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 +# BEGIN MERGE SLOT 5 -END MERGE SLOT 5 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 +# END MERGE SLOT 5 -BEGIN MERGE SLOT 6 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 +# BEGIN MERGE SLOT 6 -END MERGE SLOT 6 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 +# END MERGE SLOT 6 -BEGIN MERGE SLOT 7 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 +# BEGIN MERGE SLOT 7 -END MERGE SLOT 7 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 +# END MERGE SLOT 7 -BEGIN MERGE SLOT 8 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 +# BEGIN MERGE SLOT 8 -END MERGE SLOT 8 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 +# END MERGE SLOT 8 -BEGIN MERGE SLOT 9 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 +# BEGIN MERGE SLOT 9 -END MERGE SLOT 9 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 +# END MERGE SLOT 9 -BEGIN MERGE SLOT 10 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 +# BEGIN MERGE SLOT 10 + +# END MERGE SLOT 10 -END MERGE SLOT 10 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 diff --git a/tests/suites/test_suite_bignum_mod_raw.data b/tests/suites/test_suite_bignum_mod_raw.data index c47d47396..6644b1e22 100644 --- a/tests/suites/test_suite_bignum_mod_raw.data +++ b/tests/suites/test_suite_bignum_mod_raw.data @@ -179,82 +179,43 @@ mpi_mod_raw_cond_swap:"000000001111111122222222333333334444444455555555666666667 mbedtls_mpi_mod_raw_cond_swap: copy half of the limbs mpi_mod_raw_cond_swap:"00000000FFFFFFFF55555555AAAAAAAA":"FEDCBA9876543210FEDCBA9876543210":8 -BEGIN MERGE SLOT 1 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 +# BEGIN MERGE SLOT 1 -END MERGE SLOT 1 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 +# END MERGE SLOT 1 -BEGIN MERGE SLOT 2 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 +# BEGIN MERGE SLOT 2 -END MERGE SLOT 2 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 +# END MERGE SLOT 2 -BEGIN MERGE SLOT 3 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 +# BEGIN MERGE SLOT 3 -END MERGE SLOT 3 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 +# END MERGE SLOT 3 -BEGIN MERGE SLOT 4 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 +# BEGIN MERGE SLOT 4 -END MERGE SLOT 4 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 +# END MERGE SLOT 4 -BEGIN MERGE SLOT 5 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 +# BEGIN MERGE SLOT 5 -END MERGE SLOT 5 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 +# END MERGE SLOT 5 -BEGIN MERGE SLOT 6 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 +# BEGIN MERGE SLOT 6 -END MERGE SLOT 6 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 +# END MERGE SLOT 6 -BEGIN MERGE SLOT 7 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 +# BEGIN MERGE SLOT 7 -END MERGE SLOT 7 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 +# END MERGE SLOT 7 -BEGIN MERGE SLOT 8 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 +# BEGIN MERGE SLOT 8 -END MERGE SLOT 8 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 +# END MERGE SLOT 8 -BEGIN MERGE SLOT 9 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 +# BEGIN MERGE SLOT 9 -END MERGE SLOT 9 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 +# END MERGE SLOT 9 -BEGIN MERGE SLOT 10 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 +# BEGIN MERGE SLOT 10 + +# END MERGE SLOT 10 -END MERGE SLOT 10 -depends_on:MBEDTLS_BIGNUM_MERGE -mpi_mod_raw_io:"00":1:1:MBEDTLS_MPI_MOD_EXT_REP_BE:0:0 From 6642cafae39ee01e2767c0b13e74d4ffa057a4bd Mon Sep 17 00:00:00 2001 From: Janos Follath Date: Wed, 2 Nov 2022 16:14:08 +0000 Subject: [PATCH 07/10] Fix merge separator position Signed-off-by: Janos Follath --- tests/suites/test_suite_bignum_mod_raw.function | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/suites/test_suite_bignum_mod_raw.function b/tests/suites/test_suite_bignum_mod_raw.function index a6361d7e0..8ac1ef497 100644 --- a/tests/suites/test_suite_bignum_mod_raw.function +++ b/tests/suites/test_suite_bignum_mod_raw.function @@ -279,6 +279,7 @@ exit: mbedtls_mpi_mod_modulus_free( &m ); mbedtls_free( buff_m ); } +/* END_CASE */ /* BEGIN MERGE SLOT 1 */ @@ -319,4 +320,3 @@ exit: /* BEGIN MERGE SLOT 10 */ /* END MERGE SLOT 10 */ -/* END_CASE */ From 9cf14cd6b0efe947aee100749406a3f46788775f Mon Sep 17 00:00:00 2001 From: Janos Follath Date: Wed, 2 Nov 2022 16:15:25 +0000 Subject: [PATCH 08/10] Make pylint happy Signed-off-by: Janos Follath --- scripts/mbedtls_dev/bignum_core.py | 1 - scripts/mbedtls_dev/bignum_mod.py | 5 ----- scripts/mbedtls_dev/bignum_mod_raw.py | 5 ----- 3 files changed, 11 deletions(-) diff --git a/scripts/mbedtls_dev/bignum_core.py b/scripts/mbedtls_dev/bignum_core.py index 87098075f..0cc86b809 100644 --- a/scripts/mbedtls_dev/bignum_core.py +++ b/scripts/mbedtls_dev/bignum_core.py @@ -855,4 +855,3 @@ def mpi_modmul_case_generate() -> None: # BEGIN MERGE SLOT 10 # END MERGE SLOT 10 - diff --git a/scripts/mbedtls_dev/bignum_mod.py b/scripts/mbedtls_dev/bignum_mod.py index f4f05912f..117e1ee7b 100644 --- a/scripts/mbedtls_dev/bignum_mod.py +++ b/scripts/mbedtls_dev/bignum_mod.py @@ -14,13 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import random - from abc import ABCMeta -from typing import Dict, Iterator, List, Tuple from . import test_data_generation -from . import bignum_common class BignumCoreTarget(test_data_generation.BaseTarget, metaclass=ABCMeta): #pylint: disable=abstract-method @@ -66,4 +62,3 @@ class BignumCoreTarget(test_data_generation.BaseTarget, metaclass=ABCMeta): # BEGIN MERGE SLOT 10 # END MERGE SLOT 10 - diff --git a/scripts/mbedtls_dev/bignum_mod_raw.py b/scripts/mbedtls_dev/bignum_mod_raw.py index d5d48fe32..2a4886ca9 100644 --- a/scripts/mbedtls_dev/bignum_mod_raw.py +++ b/scripts/mbedtls_dev/bignum_mod_raw.py @@ -14,13 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import random - from abc import ABCMeta -from typing import Dict, Iterator, List, Tuple from . import test_data_generation -from . import bignum_common class BignumCoreTarget(test_data_generation.BaseTarget, metaclass=ABCMeta): #pylint: disable=abstract-method @@ -66,4 +62,3 @@ class BignumCoreTarget(test_data_generation.BaseTarget, metaclass=ABCMeta): # BEGIN MERGE SLOT 10 # END MERGE SLOT 10 - From c1a81bc998f22c57bc25318c66d1f931f06e5c5d Mon Sep 17 00:00:00 2001 From: Janos Follath Date: Wed, 2 Nov 2022 17:33:11 +0000 Subject: [PATCH 09/10] Remove trailing new lines Signed-off-by: Janos Follath --- tests/suites/test_suite_bignum_mod.data | 1 - tests/suites/test_suite_bignum_mod_raw.data | 1 - 2 files changed, 2 deletions(-) diff --git a/tests/suites/test_suite_bignum_mod.data b/tests/suites/test_suite_bignum_mod.data index d06541fd6..95faa53b8 100644 --- a/tests/suites/test_suite_bignum_mod.data +++ b/tests/suites/test_suite_bignum_mod.data @@ -64,4 +64,3 @@ mpi_mod_setup:MBEDTLS_MPI_MOD_EXT_REP_LE:MBEDTLS_MPI_MOD_REP_MONTGOMERY:0 # BEGIN MERGE SLOT 10 # END MERGE SLOT 10 - diff --git a/tests/suites/test_suite_bignum_mod_raw.data b/tests/suites/test_suite_bignum_mod_raw.data index 6644b1e22..8cbd918f8 100644 --- a/tests/suites/test_suite_bignum_mod_raw.data +++ b/tests/suites/test_suite_bignum_mod_raw.data @@ -218,4 +218,3 @@ mpi_mod_raw_cond_swap:"00000000FFFFFFFF55555555AAAAAAAA":"FEDCBA9876543210FEDCBA # BEGIN MERGE SLOT 10 # END MERGE SLOT 10 - From d820ca5d07835e490a5dcb99402be8929dff001d Mon Sep 17 00:00:00 2001 From: Janos Follath Date: Thu, 3 Nov 2022 08:42:54 +0000 Subject: [PATCH 10/10] Fix bignum test generator class names Co-authored-by: minosgalanakis <30719586+minosgalanakis@users.noreply.github.com> Signed-off-by: Janos Follath --- scripts/mbedtls_dev/bignum_mod.py | 2 +- scripts/mbedtls_dev/bignum_mod_raw.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mbedtls_dev/bignum_mod.py b/scripts/mbedtls_dev/bignum_mod.py index 117e1ee7b..2bd7fbbda 100644 --- a/scripts/mbedtls_dev/bignum_mod.py +++ b/scripts/mbedtls_dev/bignum_mod.py @@ -18,7 +18,7 @@ from abc import ABCMeta from . import test_data_generation -class BignumCoreTarget(test_data_generation.BaseTarget, metaclass=ABCMeta): +class BignumModTarget(test_data_generation.BaseTarget, metaclass=ABCMeta): #pylint: disable=abstract-method """Target for bignum mod test case generation.""" target_basename = 'test_suite_bignum_mod.generated' diff --git a/scripts/mbedtls_dev/bignum_mod_raw.py b/scripts/mbedtls_dev/bignum_mod_raw.py index 2a4886ca9..2e059b26e 100644 --- a/scripts/mbedtls_dev/bignum_mod_raw.py +++ b/scripts/mbedtls_dev/bignum_mod_raw.py @@ -18,7 +18,7 @@ from abc import ABCMeta from . import test_data_generation -class BignumCoreTarget(test_data_generation.BaseTarget, metaclass=ABCMeta): +class BignumModRawTarget(test_data_generation.BaseTarget, metaclass=ABCMeta): #pylint: disable=abstract-method """Target for bignum mod_raw test case generation.""" target_basename = 'test_suite_bignum_mod_raw.generated'