Commit Graph

141 Commits

Author SHA1 Message Date
harshal.patil 5ee161822c feat(tf-psa-crypto): Expose persistent key storage blob-size helper
Add psa_persistent_key_storage_blob_size() so callers outside tf-psa-crypto
can size the output buffer for psa_format_key_data_for_storage() without
needing to know the internal psa_persistent_key_storage_format struct.
2026-06-05 14:42:22 +05:30
harshal.patil 6cc42afad3 feat(drivers): Support persistent ESP-RSA DS driver 2026-05-07 16:34:20 +05:30
harshal.patil 73bf56ebdf fix(drivers): Support internal driver key source-specific storage layout 2026-04-27 13:09:15 +08:00
Aditya Patwardhan 53bb66126f feat(psa): Add generic secure element PSA driver dispatch
Add dispatch wrappers for secure element opaque sign, transparent verify,
import key, and export public key operations.
2026-04-20 16:57:27 +08:00
Aditya Patwardhan 3428fc6165 feat(mbedtls): Add ATECC ECDSA PSA driver 2026-04-20 16:57:11 +08:00
Ashish Sharma 9345b5878c fix(mbedtls): remove -Wdocumentation from build 2026-04-13 10:18:45 +08:00
Ashish Sharma cd0a45dc68 feat(mbedtls): adds mbedtls pre built files 2026-04-07 13:11:07 +08:00
Ashish Sharma 67a6a4091d feat(mbedtls): update to tf-psa-crypto 1.1 2026-04-02 14:42:07 +08:00
Ronald Cron 08d8cc57db Remove tf-psa-crypto directory
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-12-16 10:39:44 +01:00
Ronald Cron 45eec2295c Remove include as header path
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-12-11 22:32:45 +01:00
Ronald Cron f6d17ca13c Switch to tf-psa-crypto/build_info.h
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-12-11 22:32:45 +01:00
Paul Elliott 99ed26e0f7 Merge pull request #9808 from waleed-elmelegy-arm/add-iop-export-pub-key-complete
Add PSA interruptible export public-key complete API
2024-12-11 17:47:54 +00:00
Waleed Elmelegy 1daabc113b Refactor and improve iop export public-key setup and abort APIs
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-12-09 18:13:42 +00:00
Waleed Elmelegy f466a284c1 Fix checks for key type in psa_export_public_key_iop_setup()
Key type must be a key pair or public-key if not we return
PSA_ERROR_INVALID_ARGUMENT.

The key type must be ECC key as this is what we support for
now otherwise we return PSA_ERROR_NOT_SUPPORTED.

Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-12-09 18:12:16 +00:00
Waleed Elmelegy 4cffd5d4f3 Add implementaion for psa_export_public_key_iop_complete()
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-12-09 18:12:16 +00:00
Gilles Peskine de7aae1ba0 PSA interruptible sign/verify: detect unsupported mechanism in start
In particular, if interruptible ECDSA is supported but not the deterministic
variant, detect this in psa_sign_hash_start(), whereas before start() would
succeed and psa_sign_hash_complete() would fail. This avoids an
inconsistency between psa_sign_hash() and psa_sign_hash_start() that would
be annoying to handle in test_suite_psa_crypto_op_fail.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-12-09 18:31:59 +01:00
Gilles Peskine c5f518357d PSA sign/verify: more uniform error on an unsupported hash
Uniformly return PSA_ERROR_NOT_SUPPORTED if given an algorithm that includes
a hash, but that hash algorithm is not supported. This will make it easier
to have a uniform treatment of unsupported hashes in automatically generated
tests.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-12-09 18:31:59 +01:00
Ronald Cron 6a2cbe77fa Move driver wrappers generation to tf-psa-crypto
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-12-04 14:25:02 +01:00
Janos Follath 62e79dc913 Merge pull request #9665 from waleed-elmelegy-arm/add-iop-key-gen-get-num-ops
Add PSA interruptible key generation get num ops API
2024-12-02 09:15:36 +00:00
Waleed Elmelegy 29f65a874f Chane error code in psa_export_public_key_iop_setup() in case key size is 0
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-28 19:39:58 +00:00
Waleed Elmelegy 208c01b663 Add PSA interruptible key generation get num ops API
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-27 16:56:35 +00:00
Waleed Elmelegy 84cc90f63a Improve parameter checking 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 ada977f4c3 Add PSA iop export public-key abort API
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-27 16:08:01 +00:00
Waleed Elmelegy cd189e881b Add PSA iop export public-key setup API
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-27 16:08:01 +00:00
Waleed Elmelegy 3d5ed793e7 Add PSA internal iop export public-key abort function
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-27 16:08:01 +00:00
Janos Follath 49e6115443 Merge pull request #9651 from waleed-elmelegy-arm/add-iop-key-gen-complete
Add PSA interruptible key generation complete API
2024-11-26 18:34:40 +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
Waleed Elmelegy c57f6fcd05 Fix code stayle in iop export public-key function
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-21 16:56:52 +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
Waleed Elmelegy f5a82fd0a2 Add ecp prefix to internal iop generate key function names
Add ecp prefix to internal iop generate key function names
to emphasize that the functions are doing eliptic curves
keys only and not any other types.

Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-21 14:31:55 +00:00
Waleed Elmelegy 2266197e9c Move internal iop generate key function headers to psa_crypto_ecp.h
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-21 14:18:16 +00: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 39d54e1fb1 Prevent a warning in case PSA_VENDOR_ECC_MAX_CURVE_BITS is set to 0
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-20 15:08:52 +00:00
Waleed Elmelegy 44e0f75ca3 Use PSA Macros instead of legacy ones in psa_generate_key_iop_complete()
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-20 12:31:32 +00:00
Waleed Elmelegy db0c4a4b2c Remove MBEDTLS_ECP_MAX_MPI_BYTES macro
Remove MBEDTLS_ECP_MAX_MPI_BYTES macro as
it's not needed anymore.It was added when
memcpy was being used but now that
mbedtls_mpi_write_binary() is being used
it can handle copying a large buffer filled
with leading zeros into a smaller buffer.

Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-18 17:38:59 +00:00
Janos Follath fe4b02cc69 Merge pull request #9602 from paul-elliott-arm/add_key_agreement_negative_tests
Add key agreement negative tests
2024-11-18 13:02:03 +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
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 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
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 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 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 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 211bf6de21 cmake: Fix config files compile definitions
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 08:52:20 +01: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
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