83 Commits

Author SHA1 Message Date
Waleed Elmelegy
3c7f5c0047 Change pointer init in export public-key iop struct to NULL
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-27 16:08:01 +00:00
Waleed Elmelegy
b30233f6c3 Change key param to mbedtls_svc_key_id_t in psa_export_public_key_iop_setup()
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-27 16:08:01 +00:00
Waleed Elmelegy
9958ff6e96 Add PSA iop export public-key struct members
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-27 16:08:01 +00:00
Waleed Elmelegy
5bcd3cc217 Add internal struct for iop export public-key context
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-27 16:06:24 +00:00
Ronald Cron
28a26ece1d
Merge pull request #9771 from ronald-cron-arm/remove-psa-crypto-config
Remove MBEDTLS_PSA_CRYPTO_CONFIG configuration option
2024-11-21 16:57:55 +00:00
Ronald Cron
93ba625b96 Remove MBEDTLS_PSA_CRYPTO_CONFIG configuration option
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-21 15:52:06 +01:00
Janos Follath
f36693822f
Merge pull request #9778 from waleed-elmelegy-arm/add-iop-export-pub-key-headers
Add header and documentation for interruptible ECC export public-key
2024-11-21 13:54:29 +00:00
Waleed Elmelegy
174a4e9960 Change iop export public-key initlization example
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-21 10:54:54 +00:00
Waleed Elmelegy
a898127144 Remove PSA_ERROR_NOT_SUPPORTED as a return value to iop abort APIs
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-20 15:33:52 +00:00
Waleed Elmelegy
bf1af30ec9 Correct typos in iop export public-key headers
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-20 15:32:37 +00:00
Waleed Elmelegy
ceca4dedbe Remove mention of PSA_EXPORT_ASYMMETRIC_KEY_MAX_SIZE
Remove mention of PSA_EXPORT_ASYMMETRIC_KEY_MAX_SIZE
since it's not yet add defined in our implementation
of PSA Crypto.

Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-18 10:56:53 +00:00
Waleed Elmelegy
5fc76a91c6 Fix small typos in iop key generation & agreement APIs
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-15 17:28:29 +00:00
Waleed Elmelegy
cee3af2ca8 Add psa_export_public_key_iop_abort() header/doc
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-15 17:13:58 +00:00
Waleed Elmelegy
e5b3e66fba Add psa_export_public_key_iop_complete() header/doc
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-15 17:13:13 +00:00
Waleed Elmelegy
c8d50f5753 Add psa_export_public_key_iop_setup() header/docs
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-15 17:12:12 +00:00
Waleed Elmelegy
118b078df9 Add psa_export_public_key_iop_get_num_ops() header/docs
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-15 17:10:51 +00:00
Waleed Elmelegy
e34a5c5f9a Add psa_export_public_key_iop_s struct and docs
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-15 17:10:05 +00:00
Paul Elliott
d118cd21d6 Fix definition of psa_generate_key_iop_complete()
Incorrect usage of psa_key_id_t breaks ability to regenerate psa_sim
headers properly, should have been mbedtls_svc_key_id_t in the first
place, so replace with that.

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-11-14 19:07:58 +00:00
Janos Follath
241b9012a0
Merge pull request #9490 from waleed-elmelegy-arm/add-iop-key-agrmnt-api
Add PSA interruptible key agreement APIs
2024-11-11 09:29:16 +00:00
Gilles Peskine
4c58e89976
Merge pull request #9613 from gilles-peskine-arm/remove-rsa-psk-key-exchange
Remove RSA-PSK key exchange
2024-11-07 15:09:05 +00:00
Waleed Elmelegy
7817da0833 Improve and fix compile initializers for ECDH/ECP
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:03:49 +00:00
Waleed Elmelegy
e980fbe291 Fix codestyle in ECDH compile time initilaizers
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:03:49 +00:00
Waleed Elmelegy
f840b3a2c0 Add compile time initilaizers to ECDH and bignum structs
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:03:49 +00:00
Waleed Elmelegy
86e518b7bd Remove interuptible key agreement driver interface
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:03:49 +00:00
Waleed Elmelegy
842213811d Fix possible error in initalizing key agreement iop struct
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:03:49 +00:00
Waleed Elmelegy
a98aeaff25 Fix iop key agreement struct initilaization error on some platforms
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:03:49 +00:00
Waleed Elmelegy
93be7a175e Refactor PSA key agreement API implementation
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:03:49 +00:00
Waleed Elmelegy
26136ec98b Improve interruptible key agreement implementation
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:03:49 +00:00
Waleed Elmelegy
a2891a9ac9 Add PSA interuptable key agreement APIs
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:03:46 +00:00
Janos Follath
502ff7bcef
Merge pull request #9639 from waleed-elmelegy-arm/add-iop-key-gen-setup
Add PSA interruptible key generation setup & abort APIs
2024-11-06 09:10:42 +00:00
Gilles Peskine
b3ec125580 Remove mentions of RSA-PSK key exchange from documentation
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-05 15:49:12 +01:00
Waleed Elmelegy
b16edbef72 Improve comments for interuptible key agreement APIs
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-10-31 16:41:00 +00:00
Valerio Setti
4cfec6ffbe psa: move definition of MBEDTLS_PSA_KEY_BUFFER_MAX_SIZE
MBEDTLS_PSA_KEY_BUFFER_MAX_SIZE is only used in tests so it should
not be defined in a public header such as "crypto_extra.h".
"psa_crypto_helpers.h" is a better option.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-22 17:56:36 +02:00
Valerio Setti
a35c8a0a7e test_suite_psa_crypto: use finer grained checks on the key slot buffer size
Instead of skipping some tests when !MBEDTLS_PSA_STATIC_KEY_SLOTS,
add a proper check in the depends_on to verify if
MBEDTLS_PSA_KEY_BUFFER_MAX_SIZE is actually large enough to contain
the key used in such test.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-22 17:56:36 +02:00
Valerio Setti
f9face436a psa: move default definition of MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE
Move the default definition of MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE
from psa_crypto_core.h to the public header crypto_extra.h in order
to solve documentation build issues.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-22 17:56:36 +02:00
Valerio Setti
d813e6dd3c psa: fix some macro definition
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-22 17:56:36 +02:00
Valerio Setti
678e0fb3e5 psa: allow to use static key buffers instead of dynamic ones
This helps reducing heap memory usage and, if heap memory is
not used anywhere else in an embedded device, it also reduces
code footprint since there is no need for heap management code
in this case.

A new build symbol is added for this purpose, named
MBEDTLS_PSA_STATIC_KEY_SLOTS. It's disabled by default so that
normal usage of Mbed TLS library is not affected.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-22 17:56:36 +02:00
Waleed Elmelegy
cca4dbef4c Add PSA interruptible key generation setup & abort APIs
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-10-21 13:41:59 +01:00
Elena Uziunaite
4fd105c3fa Introduce PSA_HAVE_ALG_ECDSA_SIGN and PSA_HAVE_ALG_ECDSA_VERIFY
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-09-09 11:17:36 +01:00
Waleed Elmelegy
e25cb1bcda Fix formatting issue in psa_key_agreement() documentation
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-08-16 14:37:46 +01:00
Waleed Elmelegy
8faeee24ae Improve documentation of psa_key_agreement()
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-08-16 14:37:46 +01:00
Waleed Elmelegy
bdf2c98a27 Add psa_key_agreement() API
Add psa_key_agreement() API and basic testing.

Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-08-16 14:36:47 +01:00
Janos Follath
9e088847ae Clarify IOP key generation restriction
Public keys can't be generated.

Co-authored-by: Gilles Peskine <gilles.peskine@arm.com>
Signed-off-by: Janos Follath <janos.follath@arm.com>
2024-08-15 13:51:05 +01:00
Janos Follath
9f48917b88 Improve IOP documentation
Signed-off-by: Janos Follath <janos.follath@arm.com>
2024-08-15 13:51:05 +01:00
Janos Follath
7311600fd5 Constrain interruptible key generation to key-pairs
Erroring on a symmetric-key type would actually be an extra line of
code.

In theory we could try to save that one line of code, but it is
premature optimisation at this point. Also, this is a predominantly
asymmetric crypto feature, it is less confusing/more user friendly if we
don't allow symmetric keys here.

Signed-off-by: Janos Follath <janos.follath@arm.com>
2024-08-15 13:51:05 +01:00
Paul Elliott
0c1aa4af38 Add psa_generate_key_iop_abort() documentation
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-08-15 13:51:04 +01:00
Paul Elliott
08afb00a9b Add psa_generate_key_iop_complete() documentation
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-08-15 13:51:04 +01:00
Paul Elliott
6044f3e444 Add psa_generate_key_iop_setup() documentation
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-08-15 13:51:04 +01:00
Paul Elliott
f712452a0e Add psa_generate_key_iop_get_num_ops() docs
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-08-15 13:51:04 +01:00
Paul Elliott
9e143a73ea Add psa_generate_key_iop_t structs and docs
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
Signed-off-by: Janos Follath <janos.follath@arm.com>
2024-08-15 13:50:52 +01:00