123 Commits

Author SHA1 Message Date
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
Waleed Elmelegy
5d4de3582e rename mbedtls_psa_generate_key_complete() to mbedtls_psa_generate_key_iop_complete()
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:57:50 +00:00
Waleed Elmelegy
30437e6408 Add PSA interruptible key generation complete API
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:57:47 +00:00
Waleed Elmelegy
97041ed399 Fix Documentation issue in mbedtls_psa_key_agreement_iop_setup()
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:03:49 +00:00
Waleed Elmelegy
280e22518e Add small fixes to iop key agreement APIs
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:03:49 +00:00
Waleed Elmelegy
cd721b9870 Add a common key agreement parameter validation function across iop and normal APIs
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:03:49 +00:00
Waleed Elmelegy
18df1c560a Refactor and improve interuptible key agreement builtin implementation
- rename psa_driver_wrapper_key_agreement_xxx to
  psa_driver_wrapper_key_agreement_iop_xxx.
- reorganise the paraemters of psa_driver_wrapper_key_agreement_setup

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
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
Waleed Elmelegy
75a412f5a3 Remove mention of drivers for interuptible key generation
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-10-31 16:37:09 +00:00
Ronald Cron
50bd4f887e cmake: libs: Set libraries specific compile options target by target
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-10-25 18:09:40 +02:00
Ronald Cron
b2478989e2 cmake: GNU GCC: Set base compile options target by target
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-10-25 18:09:33 +02:00
Ronald Cron
5f6e69dae5
Merge pull request #9693 from Harry-Ramsey/split-revert-error-development
Split error.h and move back error.c to mbedtls
2024-10-25 13:12:58 +00:00
Valerio Setti
83778d7aa9 Documentation: fix some nits
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-22 17:56:36 +02:00