253 Commits

Author SHA1 Message Date
Gilles Peskine
d5d69bb4a0 Match spacing in pointer types in documentation with the code style
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:52:37 +02:00
Gilles Peskine
63d06efc38 Rename one more deprecated identifier
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:52:37 +02:00
Gilles Peskine
6b2709bf06 Documentation improvements
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:52:37 +02:00
Gilles Peskine
ae8fa71669 Rename internal function psa_key_production_parameters_are_default
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:52:37 +02:00
Gilles Peskine
ae1da9858c Remove some tests of psa_generate_key_ext
We know it's a thin wrapper around psa_generate_key_custom, so we just need
to check that it's passing the information through, we don't need coverage
of the parameter interpretation.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:49:22 +02:00
Gilles Peskine
8ae5028a1d Document the key_ext functions as deprecated
Don't formally deprecate them because we don't do that in a
long-time support branch. But do point readers away from them.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:49:22 +02:00
Gilles Peskine
e863f868ec Documentation: point to key_custom instead of key_ext
Replace references to the deprecated functions `psa_generate_key_ext()` and
`psa_key_derivation_output_key_ext()` by their replacements
Implement `psa_generate_key_custom()` and
`psa_key_derivation_output_key_custom()`.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:49:22 +02:00
Gilles Peskine
f9408282e8 Implement psa_generate_key_custom
Implement `psa_generate_key_custom()` and
`psa_key_derivation_output_key_custom()`. These functions replace
`psa_generate_key_ext()` and `psa_key_derivation_output_key_ext()`.
They have the same functionality, but a slightly different interface:
the `ext` functions use a structure with a flexible array member to pass
variable-length data, while the `custom` functions use a separate parameter.

Keep the `ext` functions for backward compatibility with Mbed TLS 3.6.0.
But make them a thin wrapper around the new `custom` functions.

Duplicate the test code and data. The test cases have to be duplicated
anyway, and the test functions are individually more readable this way.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:49:22 +02:00
Janos Follath
26561b7122 Fix typos
Signed-off-by: Janos Follath <janos.follath@arm.com>
2024-08-05 11:22:12 +01:00
Paul Elliott
e50edc0d95 Add warning about not using keys directly
Keys that are the result of key agreement have biases and really should
not be used directly. Warning taken in part from psa_raw_key_agreement()

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-08-01 18:28:07 +01:00
Paul Elliott
327da4774b Clarify key type support
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-08-01 18:27:54 +01:00
Paul Elliott
623c09a1eb Change over to psa_raw_key_agreement
psa_key_agreement exists, but only in the PSA spec, we have not
implemented it, so refer to the one we actually implemented.

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-08-01 18:16:35 +01:00
Paul Elliott
5238475ac6 Update key attribute documentation inline with PSA
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-08-01 17:52:51 +01:00
Paul Elliott
459448b8cf Neaten 'Please call next function' docs.
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-08-01 11:50:16 +01:00
Paul Elliott
4b0b35e1d7 Clarify PSA_ERROR_NOT_SUPPORTED error reasons
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-08-01 11:37:17 +01:00
Paul Elliott
8e412871c1 Clarify ops used reset logic
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-08-01 11:34:07 +01:00
Paul Elliott
9bcfd8981e improve return codes and logic description
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-08-01 10:29:24 +01:00
Paul Elliott
867815d89d Minor formatting fixes
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-07-31 18:56:36 +01:00
Paul Elliott
cae2bed689 Remove unneccessary 'Implementation' references
These were copied from the PSA docs when they should not have been.

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-07-31 18:48:34 +01:00
Gilles Peskine
4b9141ccf4
Merge pull request #9384 from eleuzi01/replace-util-have-ecdsa
Replace MBEDTLS_PSA_UTIL_HAVE_ECDSA with PSA_HAVE_ALG_SOME_ECDSA
2024-07-31 15:29:51 +00:00
Elena Uziunaite
87e0550890 Replace MBEDTLS_PSA_UTIL_HAVE_ECDSA with PSA_HAVE_ALG_SOME_ECDSA
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-07-29 12:15:22 +01:00
Elena Uziunaite
665eda7031 Introduce crypto_adjust_config_derived.h
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-07-29 12:15:22 +01:00
Elena Uziunaite
417d05f7c5 Replace MBEDTLS_ECP_HAVE_SECP256R1 with PSA_WANT_ECC_SECP_R1_256
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-07-29 11:31:20 +01:00
Paul Elliott
088fd7ec85 Add psa_key_agreement_iop_abort() documentation
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-07-19 18:27:53 +01:00
Paul Elliott
b06727e463 Add psa_key_agreement_iop_complete() documentation
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-07-19 18:25:24 +01:00
Paul Elliott
2dc58fe717 Add psa_key_agreement_iop_setup() documentation
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-07-19 18:22:23 +01:00
Paul Elliott
d791062fee Add psa_key_agreement_iop_get_num_ops() docs
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-07-19 18:17:20 +01:00
Paul Elliott
03d62b1958 Add psa_key_agreement_iop_t structs and docs
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-07-19 17:29:57 +01:00
Ronald Cron
375ad34985 Add programs directory in tf-psa-crypto directory
Add programs directory in tf-psa-crypto directory
for the tree in the directory to looks like a
TF-PSA-Crypto root tree as expected by
build_tree.py.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-07-19 10:07:27 +02:00
Ronald Cron
9a93073710 Add tf-psa-crypto test suites build
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-07-19 10:07:27 +02:00
Ronald Cron
50292a4c79 Duplicate tests CMake file
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-07-19 10:07:27 +02:00
Ronald Cron
476d51e1a7 Adapt .gitignore files
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-07-19 10:07:27 +02:00
Ronald Cron
83538c4673 Adapt path to framework data files
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-07-19 10:07:23 +02:00
Ronald Cron
701b88c54a Move crypto test suites
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-07-19 09:58:35 +02:00
Bence Szépkúti
e7fdfdb913
Merge pull request #9123 from eleuzi01/replace-mbedtls-md-can-md5
Replace MBEDTLS_MD_CAN_MD5 with PSA_WANT_ALG_MD5
2024-07-18 16:17:25 +00:00
Paul Elliott
b449476595
Merge pull request #9354 from eleuzi01/replace-ecp-have-secp512r1
Replace MBEDTLS_ECP_HAVE_SECP521R1 with PSA_WANT_ECC_SECP_R1_521
2024-07-18 15:55:41 +00:00
Paul Elliott
df772da34e
Merge pull request #9358 from eleuzi01/replace-curve
Replace MBEDTLS_ECP_HAVE_CURVE* with PSA_WANT counterparts
2024-07-18 13:54:26 +00:00
Elena Uziunaite
b66a991f04 Replace MBEDTLS_MD_CAN_MD5 with PSA_WANT_ALG_MD5
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-07-18 14:31:59 +03:00
Gilles Peskine
09b3f15c1d
Merge pull request #9285 from trustngotech/fix_platform_util
Fix typo in platform_util.c
2024-07-17 17:17:15 +00:00
Elena Uziunaite
ed784efb85 Tiny fix in pk_internal.h
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-07-17 19:16:01 +03:00
Gilles Peskine
9a75dddb5c
Merge pull request #9350 from eleuzi01/replace-ecp-have-secp224r1
Replace MBEDTLS_ECP_HAVE_SECP224R1 with PSA_WANT_ECC_SECP_R1_224
2024-07-17 13:48:40 +00:00
Michael Grand (TrustnGo)
33c62c0ac3 Fix typo in platform_util.c
Fix a typo in a conditional include.

Signed-off-by: Michael Grand (TrustnGo) <m.grand@trustngo.tech>
2024-07-17 15:24:22 +02:00
Paul Elliott
3962a38fa6
Merge pull request #9287 from Wenxing-hou/fix_some_typo
Fix some typo for include folder
2024-07-17 13:11:45 +00:00
Elena Uziunaite
b8d10876d1 Replace MBEDTLS_ECP_HAVE_BP*R1 with PSA_WANT counterparts
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-07-16 21:48:55 +03:00
Elena Uziunaite
24e24f2b5a Replace MBEDTLS_ECP_HAVE_SECP521R1 with PSA_WANT_ECC_SECP_R1_521
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-07-16 21:43:30 +03:00
Elena Uziunaite
eaa0cf0de6 Replace MBEDTLS_ECP_HAVE_SECP224R1 with PSA_WANT_ECC_SECP_R1_224
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-07-16 17:00:31 +03:00
Gilles Peskine
cb854d5d19
Merge pull request #9356 from eleuzi01/replace-ecp-have-secp-k1
Replace MBEDTLS_ECP_HAVE_SECP*K1 with PSA_WANT counterparts
2024-07-16 13:57:46 +00:00
Gilles Peskine
8e53e961be
Merge pull request #9348 from eleuzi01/replace-ecp-have-secp192r1
Replace MBEDTLS_ECP_HAVE_SECP192R1 with PSA_WANT_ECC_SECP_R1_192
2024-07-16 12:10:09 +00:00
Bence Szépkúti
ba723e8b26
Merge pull request #9265 from tom-daubney-arm/remove_hash_alt_interface
Remove hash alt interface
2024-07-15 14:22:21 +00:00
Thomas Daubney
39b5c8ad34 Remove further docs notes
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-07-15 12:15:32 +01:00