Commit Graph

34863 Commits

Author SHA1 Message Date
Gilles Peskine 1ef0e676bf Add all mechanisms up to PSA Crypto API 1.4
Define the necessary new categories (key wrap, key encapsulation, XOF).

This completes the list of mechanisms in the PSA Crypto API version 1.4,
except for PAKE that are more challenging (family parametrization, need to
find sample keys in `asymmetric_key_data.py`), and except for the PQC
extension.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-02-09 18:04:13 +01:00
Gilles Peskine e9f66f7ec2 Add DH family RFC3526
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-02-09 18:04:13 +01:00
Gilles Peskine 1e8f77d47c Add elliptic curve FRP256v1
Sample key from
https://www.ietf.org/archive/id/draft-lspm-cose-c509-test-vectors-00.html#name-weierstrass-ec-public-key-with-f

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-02-09 18:04:13 +01:00
Gilles Peskine 000b04968f Indicate the provenance of keys
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-02-09 18:04:13 +01:00
Gilles Peskine c0a8a9cbed Merge pull request #276 from gilles-peskine-arm/psasim-generate-wrappers-dynamically
psasim: generate wrappers dynamically
2026-02-09 17:58:27 +01:00
Gilles Peskine a9bb80e699 Document the psasim build
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-02-09 15:34:29 +01:00
Gilles Peskine 2bc58125fe Add missing dependencies on generated headers
Without those dependencies, the headers don't get generated.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-02-05 22:23:52 +01:00
Gilles Peskine 3a69598ade Clean up psasim/.gitignore
Add generated files that are no longer checked in.

Remove obsolete things (including things now covered at the framework root).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-02-05 14:03:57 +01:00
Gilles Peskine b6c23e6e01 Remove psasim generated files
The files are now generated during the build. Stop having them in version
control.

As formerly in Mbed TLS, `make clean` doesn't remove
configuration-independent target-independent generated files, but the new
target `make neat` does.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-02-05 13:58:22 +01:00
Gilles Peskine 9dca598383 Add rules to generate wrappers during the psasim build
We don't need to check those generated files into version control.

This fixes the problem that the generated files have precise knowledge of
the functions that exist on whatever branch of TF-PSA-Crypto is consuming
the framework.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-02-05 13:58:22 +01:00
Gilles Peskine 4b0febffa1 psasim: Update generation script instructions for the TF-PSA-Crypto split
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-02-05 13:39:25 +01:00
Gilles Peskine 499dd4322e Update psasim generated files
TF-PSA-Crypto no longer has `psa_can_do_hash()` (except as a temporary stub
to avoid breaking the build of psasim).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-02-05 13:38:12 +01:00
Gilles Peskine 8ebca51516 Merge pull request #275 from gilles-peskine-arm/mldsa-pqcp-add-driver-framework-return-of-the-psasim
psasim: Read include paths from the TF-PSA-Crypto makefile
2026-01-29 12:39:49 +01:00
Gilles Peskine c5c6dda693 Read include paths from the TF-PSA-Crypto makefile
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-27 18:25:25 +01:00
David Horstmann 421f7a29f7 Merge pull request #238 from minosgalanakis/rework/move-psasim
Move psasim into framework
2026-01-23 15:23:09 +00:00
Gilles Peskine b4d205efc4 Merge pull request #273 from gilles-peskine-arm/mldsa-pqcp-add-driver-framework-the-split-strikes-back
Framework support for the pqcp driver, again
2026-01-21 13:49:24 +01:00
Gilles Peskine 84a637899a Add pqcp path when building in mbedtls as well
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-20 11:32:01 +01:00
Gilles Peskine 93d94f4b42 c_build_helper: don't hide the compiler output
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-20 11:31:45 +01:00
Valerio Setti ece660e1cf Merge pull request #271 from gilles-peskine-arm/mldsa-pqcp-add-driver-framework
Framework support for the pqcp driver
2026-01-19 16:40:28 +01:00
Gilles Peskine 390abf3b39 Fix compatibility with old CMake
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-19 12:36:38 +01:00
Gilles Peskine ab1a43e781 check_names: Use the same Python executable instead of python3
Fix build failure in environments where `python3` doesn't exist or is too
old.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-19 12:34:34 +01:00
Gilles Peskine 18525876aa check_names: allow pqcp driver to configure mldsa-native
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-15 19:31:32 +01:00
Gilles Peskine 0c94e7d164 check_names: Allow mldsa-native symbols to be undeclared
The mldsa-native and mlkem-native headers use preprocessor tricks to
construct identifiers. We can't recognize those. So f a symbol found in the
binary is in the expected sub-namespace for those parts of the library,
allow it to be undeclared.

Make the exception general enough for mldsa-native (needed now) and
mlkem-native (needed soon).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-15 19:31:27 +01:00
Gilles Peskine dd06b4989f check_names: tighten the pattern for internal macros
The pattern for internal macros was weird, in part, because of the unusual
short names we use in bignum code. Make the pattern stricter, but add an
exception mechanism. Declare an exception for those bignum names, but
allow them only in bignum code.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-15 19:23:27 +01:00
Gilles Peskine 21007fc2bc check_names: use set, not list, when only testing membership
It's both clearer and faster.

No semantic change.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-15 18:09:14 +01:00
Gilles Peskine 2f01eca203 check_names: add type annotations
I needed that to understand how the data is represented (str vs Match, list
vs set vs tuple, ...).

No semantic change.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-15 18:09:08 +01:00
Gilles Peskine 8caa0e42ab check_names: Use dedicated class for parse results
Use a typed namespace instead of a dictionary with heterogenously typed values.

No semantic change.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-15 18:08:56 +01:00
Gilles Peskine 8b6217bba8 check_names: don't build what we don't need
We only look at symbols in the library, so don't bother building tests.

No semantic change.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-15 18:08:46 +01:00
Valerio Setti b392da5c46 Merge pull request #257 from valeriosetti/issue598-framework
[framework] tests: pk: add a common function to create a PSA key out of predefined keys
2026-01-15 16:55:35 +01:00
Valerio Setti c32c5064c0 tests: pk_helpers: fix code style
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-01-15 10:11:37 +01:00
Valerio Setti 73c4f2e5d6 tests: pk_helpers: improve documentation of pk_context_populate_method_t
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-01-14 23:33:50 +01:00
Valerio Setti 4eebe42a11 tests: pk_helpers: optimize failure reporting in mbedtls_pk_helpers_populate_context
Keep TEST_EQUAL() on the function that might fail so that if a failure
happen the message will report the actual function that failed.

Documentation of the helper function is also updated.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-01-14 23:09:35 +01:00
Valerio Setti 2d7c5cb574 tests: pk_helpers: fix outer guard in functions implementation
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-01-14 12:54:37 +01:00
Valerio Setti 43e4dc061d tests: pk_helpers: update documentation
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-01-14 12:54:10 +01:00
Valerio Setti 2b3cc12c01 tests: pk_helpers: let all helper function return an error code
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-01-14 12:53:25 +01:00
Gilles Peskine fceee93024 Add drivers/pqcp/include to C include paths
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-12 13:26:25 +01:00
Ronald Cron ebad5b9817 Merge pull request #270 from gilles-peskine-arm/make_generated_files-use_same_python
Use the same Python executable instead of `python`
2026-01-12 12:04:30 +01:00
Gilles Peskine a56534ba79 Use the same Python executable instead of python
`python` might be the wrong version, for example it might be Python 2 on
some systems, or it might be a different version of Python 3. Use
`sys.executable`, so that the same version gets used consistently.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-09 20:44:58 +01:00
Gilles Peskine ee399cc257 Merge pull request #245 from gilles-peskine-arm/make_generated_files-fix-check
Fix make_generated_files --check
2026-01-09 10:46:49 +01:00
Minos Galanakis f51cf54fd4 all-core.sh: Allow overriding of the psa-sim location
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-01-08 17:46:11 +00:00
Minos Galanakis 7f6ad7c9b8 psasim: Update location in Makefile and all-core.sh
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-01-08 17:45:54 +00:00
Minos Galanakis fc4689b631 Removed old psasim dir
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-01-08 17:45:19 +00:00
Minos Galanakis daee5e1925 Merge branch 'tmp-branch-move-files-to-framework' into move-files-into-framework
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-01-08 17:43:06 +00:00
Minos Galanakis d9823616cf Moved tests/psa-client-server to framework.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-01-08 17:15:35 +00:00
Minos Galanakis bf381062bf psasim: Moved to psasim_deprecated
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-01-08 17:13:53 +00:00
Valerio Setti 0294b11967 Merge pull request #10556 from gilles-peskine-arm/sha3-cleanup-202512-prep2
SHA3 cleanup prep: Adapt to the split of test_suite_shax
2026-01-08 12:18:28 +00:00
Valerio Setti dae1609b58 Merge pull request #253 from gilles-peskine-arm/all.sh-cleanup-cmake-only-in-tree
Only clean CMake artifacts in-tree
2026-01-08 10:49:05 +01:00
Valerio Setti fa298be91a tests: src: pk_helpers: style fix in code and documentation
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-01-08 09:28:34 +01:00
Valerio Setti e28511869c tests: src: pk_helpers: select predefined keys using PSA key type and bits
A new look-up table is created, "predefined_keys_psa", to list all the
predefined keys together with the corresponding PSA key type and bits.
A new look-up table was created in order not to conflict with the already
existing "predefined_keys" one.

"mbedtls_pk_helpers_get_predefined_key_data" is modified in order to
use the new look-up table.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-01-08 09:16:21 +01:00
Gilles Peskine 898a721b9d Fix missing cleanup of toplevel Makefile
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-07 19:52:49 +01:00