Backport 1.1: Add driver and dispatch for MLDSA#750
Conversation
483a399 to
bcca624
Compare
|
This needs a submodule update. I'll wait until #748 is merged, then I'll rebase here. |
| import os | ||
| import sys | ||
|
|
||
| sys.path.append(os.path.join(os.path.dirname(__file__), |
There was a problem hiding this comment.
If you run this with python3 tests/scripts/check_committed_generated_files.py --list-targets it will fail with ModuleNotFoundError. Is this expected?
There was a problem hiding this comment.
Works for me.
Do you have all the required packages in your Python environment? Note that you need framework/util/requirements.txt in addition to scripts/maintainer.requirements.txt. (Cleaning this up is on the Python tech debt pile.)
There was a problem hiding this comment.
Yeah, I think this is minor you need to install dilithium-py. It may be worth re-orging the imports, so you can run this without the dependancy. Though the gain is marginal, if anything.
| public_key->x, public_key->len, | ||
| alg_arg, | ||
| message->x, message->len, | ||
| signature->x, signature->len + 1), |
There was a problem hiding this comment.
Should this be buf not signature->x, otherwise presumably we will read past the end of signature->x?
| public_key->x, public_key->len, | ||
| alg_arg, | ||
| message->x, message->len, | ||
| signature->x, signature->len - 1), |
There was a problem hiding this comment.
Presumably this should be buf and signature->len, not signature->x and signature->len - 1, as otherwise we will discount the last byte and not passed the flipped version?
| @@ -0,0 +1,26 @@ | |||
| #!/usr/bin/env python3 | |||
There was a problem hiding this comment.
Does this need a copyright header
Only three entry points for now: `export_public_key`, `sign_message` (deterministic algorithms only since this is a known-answer test), `verify_message`. More to come as we work on Mbed-TLS#699 . Add a few test cases, basically just smoke tests, using test data from `test_suite_psa_crypto.data`. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This directory is currently excluded from `check-python-files.sh`, because we run it on the CI in an old Python version that doesn't support some of our new maintainer scripts (specifically, to start with, the MLDSA test generator). Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Let the framework decide about test cases. But let each consuming branch decide which test suites and which test function it wants. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
No change to what is being tested, but the data flow is now clearer. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
bcca624 to
8723ca0
Compare
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
67f5f79
Partial backpot of #700: not the new feature (the driver entry points and the dispatch layer for ML-DSA, and the corresponding tests), but the other parts, namely:
test_suite_dispatch_transparentscripts/maintainterframework/scripts/generate_mldsa_tests.pyPR checklist