Skip to content

Support committed generated test data and generate PQCP test data#278

Merged
valeriosetti merged 8 commits intoMbed-TLS:mainfrom
gilles-peskine-arm:generate_mldsa_tests-create
Feb 27, 2026
Merged

Support committed generated test data and generate PQCP test data#278
valeriosetti merged 8 commits intoMbed-TLS:mainfrom
gilles-peskine-arm:generate_mldsa_tests-create

Conversation

@gilles-peskine-arm
Copy link
Copy Markdown
Contributor

@gilles-peskine-arm gilles-peskine-arm commented Feb 11, 2026

  1. Prepare to support more committed generated files.
  2. Prepare to have additional Python scripts in framework/util, according to the design proposed in Design proposal: split user-invoked from CI-invoked Python scripts #272.
  3. New script to generate ML-DSA test data, in partial fulfillment of Write PSA driver for ML-DSA using mldsa-native TF-PSA-Crypto#633. Requires steps 1 and 2.

Framework part of Mbed-TLS/TF-PSA-Crypto#690.

PR checklist

Please add the numbers (or links) of the associated pull requests for consuming branches. You can omit branches where this pull request is not needed.

@gilles-peskine-arm gilles-peskine-arm added needs-ci Needs to pass CI tests size-s Estimated task size: small (~2d) priority-high High priority - will be reviewed soon labels Feb 11, 2026
@gilles-peskine-arm gilles-peskine-arm added needs-preceding-pr Requires another PR to be merged first and removed needs-ci Needs to pass CI tests labels Feb 12, 2026
@gilles-peskine-arm gilles-peskine-arm added needs-review Every commit must be reviewed by at least two team members. needs-reviewer This PR needs someone to pick it up for review labels Feb 12, 2026
Copy link
Copy Markdown

@bjwtaylor bjwtaylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not had time to do a full review, however added a couple of initial comments/questions.

Comment thread scripts/mbedtls_framework/crypto_knowledge.py Outdated
Comment thread util/requirements.txt
Comment thread scripts/mbedtls_framework/crypto_knowledge.py Outdated
@valeriosetti valeriosetti self-requested a review February 16, 2026 10:00
@valeriosetti valeriosetti removed the needs-reviewer This PR needs someone to pick it up for review label Feb 16, 2026
@valeriosetti
Copy link
Copy Markdown
Contributor

Since #265 has been merged, you might rebase this PR so that we can get it merged and unlock Mbed-TLS/TF-PSA-Crypto#690 as well ;)

@gilles-peskine-arm
Copy link
Copy Markdown
Contributor Author

Oh, I hadn't rebased because there was no conflict, but now there is one! Ronald and I simultaneously created a file with the same name... I'll rework this then.

@gilles-peskine-arm gilles-peskine-arm force-pushed the generate_mldsa_tests-create branch from 664d22c to 8b37b49 Compare February 19, 2026 17:23
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>
A new utility to give a common interface to committed generated files.

For the time being, this module is only intended for committed generated
files, and `make_generated_files_common.py` is only intended for non-committed
generated files. The two may be unified at some point in the future.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
As part of a long-term unification effort of generation scripts, add an
option for test generators to list oudated targets without writing to files.
This corresponds to functionality that the new generate_files_helper module
offers.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Support check and always-update mode. Update-if-needed mode falls back to
always-update mode because test_data_generation.py doesn't support
update-if-needed.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Generate some basic test cases for the mldsa-native functions.

Uses `dilithium_py` from https://github.com/GiacomoPope/dilithium-py
(`pip install dilithium-py`), which requires Python >=3.9.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
@gilles-peskine-arm gilles-peskine-arm force-pushed the generate_mldsa_tests-create branch from 8b37b49 to c88127f Compare February 19, 2026 17:24
@gilles-peskine-arm gilles-peskine-arm removed the needs-preceding-pr Requires another PR to be merged first label Feb 19, 2026
@gilles-peskine-arm
Copy link
Copy Markdown
Contributor Author

I've rebased on top of the merge of #265. I also renamed scripts/mbedtls_framework/generated_files.py to scripts/mbedtls_framework/generate_files_helper.py to disambiguate it from the scripts/mbedtls_framework/generated_files.py that Ronald added in parallel. This is ready for review if the CI agrees.

valeriosetti
valeriosetti previously approved these changes Feb 20, 2026
Copy link
Copy Markdown
Contributor

@mpg mpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Taking over from Ben as a reviewer while he's away.)

Looking pretty good to me. Just a minor point that can be ignored, and a question that's probably just me missing something but I'd still like it answered before I formally approve.

Comment thread util/generate_mldsa_tests.py
Comment thread util/generate_mldsa_tests.py
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>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Copy link
Copy Markdown
Contributor

@mpg mpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@mpg mpg requested a review from valeriosetti February 26, 2026 09:10
@github-project-automation github-project-automation bot moved this from In Development to Has Approval in Roadmap pull requests (new board) Feb 27, 2026
@valeriosetti valeriosetti added approved Design and code approved - may be waiting for CI or backports and removed needs-review Every commit must be reviewed by at least two team members. labels Feb 27, 2026
@valeriosetti valeriosetti merged commit e07b664 into Mbed-TLS:main Feb 27, 2026
2 checks passed
@github-project-automation github-project-automation bot moved this from Has Approval to Done in Roadmap pull requests (new board) Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Design and code approved - may be waiting for CI or backports priority-high High priority - will be reviewed soon size-s Estimated task size: small (~2d)

Development

Successfully merging this pull request may close these issues.

4 participants