Multipart sign/verify: dispatch functions, dispatch to ML_DSA#775
Open
gilles-peskine-arm wants to merge 24 commits intoMbed-TLS:developmentfrom
Open
Multipart sign/verify: dispatch functions, dispatch to ML_DSA#775gilles-peskine-arm wants to merge 24 commits intoMbed-TLS:developmentfrom
gilles-peskine-arm wants to merge 24 commits intoMbed-TLS:developmentfrom
Conversation
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
In setup, only validation is implemented, not the storing of the key or the start of the operation. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
As with the key type and algorithm macros, they are in the driver header for now, and will move to the public API headers once MLDSA is reachable from the API. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
In setup, only validation is implemented, not the key expansion or the start of the operation. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This is a deviation from the application interface, which is practical given that the core is supposed to have a copy of the key in the key store, and is useful because it saves the driver from needing to make its own copy. ARM-software/psa-api#350 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>
Copy the expanded private key on the heap from setup to finish. Temporarily allocate the public key on the heap during setup. 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>
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>
There is nothing to dispatch to yet. But as a signpost, write never-enabled boilerplate code to dispatch to test drivers (not written yet) and to the built-in implementation (not written yet: we do not yet support any algorithm that isn't hash-then-sign or sign-small-message). Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
There is nothing to dispatch to yet, so we're just checking that setup returns `PSA_ERROR_NOT_SUPPORTED` and abort returns `PSA_SUCCESS`.. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
…operation Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This is a deviation from the application interface, which is practical given that the core is supposed to have a copy of the key in the key store, and is useful because it saves the driver from needing to make its own copy. ARM-software/psa-api#350 Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Add functions to test the whole sequence (setup, update(s), finish). Also add test functions that focus on finish. There are no test cases yet since no algorithm is supported yet. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
We need this to give it a driver ID for multipart operation dispatch, even if none of the driver entry points are satisfactorily supported by `generate_driver_wrappers.py`. The `"export_public_key"` entry point is present in the driver and is supported by `generate_driver_wrappers.py`. However, this is not usable because the template `psa_crypto_driver_wrappers_no_static.c.jinja` insists that dispatch to all non-built-in transparent drivers is guarded by `PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT`, but dispatch to ML-DSA must not be guarded by this macro. Sorting this out is out of scope here, so keep using the manually written code to dispatch `"export_public_key"` to the PQCP driver. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Reject calls to `set_context` for now. It will be implemented later. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Add tests that exercise checks done by setup and finish stages. Mostly bad cases, with a few good cases for reference. Copy of `tests/suites/test_suite_psa_crypto_mldsa.multipart.data`. We test ML-DSA at the dispatch layer fairly extensively because we don't have the API layer yet, and we expect early birds to access ML-DSA via the dispatch layer. The tests focus on the behavior of our driver, and may need to be revised when we start supporting third-party drives. In other words, in the future, some of the test coverage added in this commit will move to API layer tests, and some of the test coverage added in this commit will become irrelevant because it's too specific to our implementation. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
5 tasks
| # Tests that are not covered for a tracked reason, and that | ||
| # were also not covered by Mbed TLS testing as of Mbed TLS 4.1.0. | ||
| UNCOVERED_TESTS = { | ||
| 'test_suite_config.crypto_combinations': [ |
Contributor
Author
There was a problem hiding this comment.
We also need to add this (and maybe more) to tf_psa_crypto_test_case_info.py.INTERNAL_TEST_CASES``. This requires Mbed-TLS/mbedtls#10700 (I don't want to add it yet to avoid a merge conflict).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the driver dispatch functions for multipart signature and verification. Add dispatch to ML-DSA only, PQCP driver only.
Follow the driver interface for multipart sign/verify that I proposed in ARM-software/psa-api#350
Resolves #771
Prerequisites:
Status: feature complete. Needs the prerequisites to be merged and then a tweak to pacify Mbed TLS's outcome analysis.
PR checklist