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>
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>
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>
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>
Tests using randomized signatures were currently randomized. We need the
output of the script to be reproducible, so this won't do.
Force randomized signatures to use a specific RNG which is reset before
constructing each test case. This way, the script's output is reproducible.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Create a directory for scripts that are useful to maintainers, and may be
invoked as part of the CI, but are not part of the normal build.
These scripts may require a recent Python version and may require additional
third-party modules, unlike user-facing scripts where we try to minimize
requirements.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>