Add mldsa-native and pqcp driver#652
Conversation
|
@ronald-cron-arm I would appreciate a design review (no need to do a code review) on the file structure and CMake build. It's passing the CI (as of e663621, the remaining CI failures are not related to the build system) but I don't know if I've done things right. One thing I wonder is if we should have three places for headers in a driver and not just two:
|
valeriosetti
left a comment
There was a problem hiding this comment.
A part from the very 2 minimal typos the rest look good to me!
I noticed that you updated the framework twice, which is fine of course because you are updating it in a progressive way, but in case of conflicts it might be pain to refresh. I don't mind if you want to just update the framework once as first commit.
This reverts commit fb5e160. The compilation failure has been fixed upstream (pq-code-package/mldsa-native#884), and we're picking up the fix in the initial integration (Mbed-TLS/TF-PSA-Crypto#652), so we won't need this temporary workaround for our development branch after all. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
|
Once the CI passes and the content is approved, I will do a little history rewriting:
|
|
The CI has passed. Please review. Once the pull request is approved, I'll do a double rebase: a change of base to resolve the framework conflict, and some history rewriting to squash fixup commits (and fix DCO). |
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>
This way we can have build scripts that don't know about the pqcp driver, and they will work as long as the library configuration doesn't enable a PQCP feature (i.e. ML-DSA). Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Currently, the libtestdriver1 build in tests/Makefile in Mbed TLS creates empty files `everest/Makefile.inc` and `p256-m/Makefile.inc` in the libtestdriver1 tree, but does not know about `pqcp/Makefile.inc` which came along later. Instead of requiring these files to exist, just don't try to include them. Either way, libtestdriver1.a can't use any code from third-party drivers. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
When we build libtestdriver1, the generated files are already present in the original source tree, and we copy them to the libtestdriver1 tree. Thus we don't need to generate them in the libtestdriver1 tree. Skip all the code that tries to generate them, including file enumeration and dependencies. The current version of `generate_config_checks.py` doesn't work in the libtestdriver1 tree. This caused error messages when the makefile ran `generate_config_checks.py --list`, but the build worked anyway because the necessary targets were already present. So the practical consequence of this commit is to suppress a confusing but effectively harmless error trace. 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>
The pqcp driver doesn't need a public include yet. But `drivers.cmake` declares an include directory. When a CMake package includes TF-PSA-Crypto as a sub-package, this include directory must exists, otherwise it breaks the build, as revealed by `all.sh test_tf_psa_crypto_as_package`. So start having a public include, we will need it eventually. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Explain more precisely how mldsa-native functions end up being called `tf_psa_crypto_pqcp_mldsa87_xxx`. In `pqcp-config.h`, fix an obsolete explanation of the macros that the wrapping code needs to define. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
There are still build scripts that can't find headers in the new pqcp driver, notably libtestdriver1. For the time being, take advantage of the fact that pqcp is not in the default config, so we don't need to update these build scripts yet. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
a4bb15d to
3a25c91
Compare
|
I have pushed a rebase of the branch on top of the latest target branch, to resolve the conflict in the framework. The history is the same except that I removed all commits that update the framework submodule or the mldsa-native submodule, and I changed the commit that adds the mldsa-native submodule to directly add the latest I will now push a second rebase that keeps the same fork point, but squashes some boring parts of the history and will pass DCO:
The end result is identical to |
3a25c91 to
8f09b37
Compare
|
The CMake part of the PR looks good to me. It's good to see that you have been able to use |
Resolves #628. Resolves #655 since the WIndows CI is passing.
Note to reviewers: non-goals:
fullconfig).Needs preceding PR:
CMakeLists.txtin mbedtls isn't split: CMake: Declare pqcp driver to mbedtls mbedtls#10569The Windows build fails.Fix mldsa-native integration on MSVC #655 is solved upstream. This should make the WIndows build pass.PR checklist