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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
* 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>
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>
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>
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>