32502 Commits

Author SHA1 Message Date
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
fad77f1ff4 Add iop export public-key generated test wrappers
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-15 17:27:36 +00:00
Waleed Elmelegy
bdb6385945 Add iop export public-key dummy API implementations
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-15 17:26:34 +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
Ronald Cron
fee08b45e2
Merge pull request #9760 from ronald-cron-arm/tf-psa-crypto-cmake
Finalize the integration of the TF-PSA-Crypto build system into the Mbed TLS one
2024-11-15 17:05:16 +00:00
Paul Elliott
66d7bcbef1 Add key export on successful key agreement
More sanity checks on key coming out of key agreement.

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-11-15 14:09:03 +00:00
Paul Elliott
7267e56189 Fix incorrect return code
Code return differs from raw agreement, so tests fail.

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-11-15 14:09:03 +00:00
Paul Elliott
2c9d398553 Add new psa_key_agreement() to key exercises
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-11-15 14:09:03 +00:00
Paul Elliott
c54fcc765e Add new psa_key_agreement() to key_agreement_fail()
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-11-15 14:09:03 +00:00
Paul Elliott
b1039afbd0 Regenerate PSA Sim headers
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-11-15 14:09:03 +00:00
Paul Elliott
958bdf7f16 Add required code to psa_sim_generate.pl
Non generated code was unfortnuately added to psa_sim_crypto_server.c,
fix that by adding it to the generation scripts.

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-11-15 14:09:03 +00:00
Ronald Cron
8237484318 cmake: Use TF_PSA_CRYPTO_CONFIG_FILE to prefix crypto targets
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-15 15:05:34 +01: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
Ronald Cron
d779e95720 Fix cmake option name
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 16:25:34 +01:00
Waleed Elmelegy
e0dac22cf1 Change MBEDTLS_ECP_MAX_MPI to MBEDTLS_ECP_MAX_MPI_BYTES for better clarity
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-14 15:16:58 +00:00
Ronald Cron
0cc68601e6
Merge pull request #9611 from gabor-mezei-arm/9142_update_depends.py_cipher_chaining_domain
Update the `cipher_chaining` domain to use PSA macros in `depends.py`
2024-11-14 14:32:35 +00:00
Ronald Cron
939ce9d0d5 Remove mbedtls_test
Use tf_psa_crypto_test instead.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 13:52:36 +01:00
Waleed Elmelegy
a3ce631849 Refactor mbedtls_psa_generate_key_iop_complete()
- Move the checks on the size to the start of the
  function to avaoid costly calls to mbedtls_ecp_gen_privkey()
  in case of invalid size.
- Improve the readability of error checking

Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-14 12:51:08 +00:00
Ronald Cron
bea67a1ebf Fix everest build
Fix everest build following the merge of
9490. By the way removed an unnecessary
link of the everest lib to mbedtls test
executable. It comes through the mbedtls
library that gets it from the tfpsacrypto
library.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 11:27:49 +01:00
Manuel Pégourié-Gonnard
824a8dcde3
Merge pull request #9769 from mpg/move-all-core-dev
Move all-core and all-helpers to the framework
2024-11-14 09:51:24 +00:00
Ronald Cron
0381a98114 cmake: Move copy of crypto libraries to mbedtls
Move copy of crypto libraries to mbedtls as this
copy does not make sense in TF-PSA-Crypto context.
Also copy all of them, not just tfpsacrypto.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 09:28:27 +01:00
Ronald Cron
8126a686d9 cmake: Rename mbedcrypto library to tfpsacrypto
Do not do the same in the make build system yet,
cmake build system only scope for this PR.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 09:28:27 +01:00
Ronald Cron
b7d0e52e16 cmake: Rename mbedcrypto target to tfpsacrypto
Rename mbedcrypto target to tfpsacrypto and
prefix all cmake related variables with
tfpsacrypto instead of mbedcrypto.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 09:28:27 +01:00
Ronald Cron
020e026779 cmake: tf-psa-crypto: Add cmake_subproject test program
The empty framework directory is temporary. It will be
removed when TF-PSA-Crypto uses its framework submodule.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 09:28:21 +01:00
Manuel Pégourié-Gonnard
845cc54d69 Update framework pointer
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-11-14 09:14:51 +01:00
Ronald Cron
1a52bc4802 cmake: mbedtls: Propagate options and target prefix
Propagate mbedtls options named differently in
TF-PSA-Crypto.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 09:06:47 +01:00
Ronald Cron
97cfd707ee tf-psa-crypto: cmake: Let TF-PSA-Crypto.cmake be the top cmake file
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 09:06:47 +01:00
Ronald Cron
d3b33a2e81 Finalize TF-PSA-Crypto.cmake to become the top cmake file
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 09:06:47 +01:00
Ronald Cron
ba850f3207 Rename export MbedTLSTargets to TF-PSA-CryptoTargets
Keep installations on MbedTLSTargets export
crypto libraries for the sake of mbedtls.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 09:06:47 +01:00
Ronald Cron
2609fe9155 cmake: tf-psa-crypto: Rename mbedtls_test to tf_psa_crypto_test
To avoid conflict between the two targets when
the integration of the TF-PSA-Crypto cmake build
system into the Mbed TLS one is completed.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 09:06:47 +01:00
Ronald Cron
a9219ff73d Add project prefix to API documentation targets
To avoid conflict between the two targets when
the integration of the TF-PSA-Crypto build system
into the Mbed TLS one is completed.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 09:06:47 +01:00
Ronald Cron
169393e6ae Restrict the definition of memcheck/lcov targets
Restrict the definition of memcheck/lcov targets
to the case where Mbed TLS/TF-PSA-Crypto is the
main project. To avoid conflict between the
targets when the integration of the TF-PSA-Crypto
build system into the Mbed TLS one is completed.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 09:06:47 +01:00
Ronald Cron
564b1cb643 tf-psa-crypto: cmake: Fix target for compile options
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 09:06:47 +01:00
Ronald Cron
735dd65035 Fix mbedcrypto pkg-config file
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 09:06:47 +01:00
Ronald Cron
13a7ccec76 Align all.sh tf-psa-crypto components naming
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 09:06:29 +01:00
Ronald Cron
211bf6de21 cmake: Fix config files compile definitions
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 08:52:20 +01:00
Harry Ramsey
4c59cee9ed Remove documentation regarding MBEDTLS_GCM_ALT
MBEDTLS_GCM_ALT has been removed in the current version.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-11-13 19:08:49 +00:00
Waleed Elmelegy
8666b0fbc8 Add MBEDTLS_ECP_MAX_MPI define
Add MBEDTLS_ECP_MAX_MPI define to determine the maximum
number of bytes for the biggest Elliptic curve in bignum
representation.

Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-13 13:20:20 +00:00
Waleed Elmelegy
a47b82c20a Fix issue exporting generated key to raw intermediate buffer
* Used bignum helper API instead of memcpy
* changed the key length output to the size of the curve because:
  - using the bignum produces a bigger size than the curve size
    due to the limb size being 8 bytes and import key rejects
    the key if it's not exactly curve size.
  - we know that the generated key is filled with leading
    zeros becuase the generated key is bounded by the modulas.
* skipped leading zeros when passing the buffer to import_key()
  due to the intermediate buffer allocated to the maximum size
  possible and import_key() needs the exact size.

Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-13 13:11:47 +00:00
Waleed Elmelegy
bd36c4746a Stop IOP generate key complete test in case expected value is not success
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-13 13:08:26 +00:00
Harry Ramsey
6a91defd42 Fix check_names error for MBEDTLS_GCM_ALT comment
This commit fixes an issue with check_names failing due to not being
defined as a macro in Mbed TLS. This is instead defined by alternative
implementations of MBEDTLS_GCM.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-11-13 09:45:09 +00:00
Gabor Mezei
6763a5546a
Update comments
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-11-12 18:26:34 +01:00
Gabor Mezei
655c487edb
Update dependencies
Added `MBEDTLS_CIPHER_MODE_XTS` as a dependency for `PSA_WANT_ALG_XTS`.
Otherwise, `MBEDTLS_CIPHER_MODE_XTS` is always enabled which enables a
lot of code we would like to be disabled when testing CFB/CTR... only.

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-11-12 18:26:34 +01:00
Gabor Mezei
af198c2ee5
Rename variable
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-11-12 18:26:34 +01:00
Gabor Mezei
242806ad6f
Update dependencies
All cipher padding methods depend on CBC. To aviod switching it off
add this dependency to all of the methods and handle it as a common dependency.

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-11-12 18:26:34 +01:00
Gabor Mezei
a5f35296bd
Update comment
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-11-12 18:26:34 +01:00