11 Commits

Author SHA1 Message Date
Gilles Peskine 88cfd0cf47 Improve the construction of inputs to multipart APIs
Fix a bug whereby the chunks did not actually have the desired lengths.

Make the message content depend only on its length, and not how it is split
into chunks. This way, it'll be easier to notice and analyze bugs that cause
different outputs for different ways to split the input.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-04-23 15:43:05 +02:00
Gilles Peskine ffc707d4f6 Support generating multipart tests for driver and dispatch
Not done by default for smooth transition in the consuming TF-PSA-Crypto
branch. It's up to the calling script `generate_mldsa_tests.py` to
enable the new test cases.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-04-20 15:18:41 +02:00
Gilles Peskine f8d36c84ac Speed up generation by caching signatures
We tend to generate the signature of the same message under the same keys
multiple times for different APIs (sign/verify, driver/dispatch, ...).
Caching results makes the script noticeably faster.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-04-20 10:13:21 +02:00
Gilles Peskine dcf227c5b9 Generate MLDSA test cases for the driver dispatch layer
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-31 16:01:03 +02:00
Gilles Peskine 4a58f90329 Generate MLDSA test cases for the driver entry points
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-31 16:01:03 +02:00
Gilles Peskine 6466dc62c3 Make mbedtls_maintainer a Python package
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-31 15:19:41 +02:00
Gilles Peskine 85a47fc277 mldsa_test_generator refactor: new methods gen_key_management, gen_all
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-31 15:19:41 +02:00
Gilles Peskine a53c51425d mldsa_test_generator refactor: change function calls to method calls
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-31 15:19:41 +02:00
Gilles Peskine 38d9d83ae7 mldsa_test_generator refactor: extend API class to Generator
Turn functions that generate test cases into methods of the generator class.
Functions that used to take an API argument are now implemented in the
generic class, and API-specific functions are now methods of the
corresponding API-specific concrete class.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-31 15:19:41 +02:00
Gilles Peskine 31bae441f6 mldsa_test_generator refactor: preliminary rearrangement
Move code around, to make subsequent diffs easier to review.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-31 15:19:41 +02:00
Gilles Peskine 72f178bdbd Move most of generate_mldsa_tests.py into a module
We are moving the command line entry point to the consuming branch.

The move will be completed when the consuming branch no longer needs the
script to exist in the framework.
https://github.com/Mbed-TLS/mbedtls-framework/issues/294

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-31 15:19:41 +02:00