Commit Graph

10 Commits

Author SHA1 Message Date
Maciej Baczmanski 85bc24eb07 net: openthread: Add PSA implementation for PBDKF2 genkey
Add implementation of openthread pbkdf2 generate key using PSA
functions.

Co-authored-by: Joakim Andersson <joakim.andersson@nordicsemi.no>

Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
2024-01-26 11:03:42 +01:00
Przemyslaw Bida a6184b9be3 net: openthread: Fix key import in case of ECDSA.
According to PSA specification in case of `PSA_KEY_TYPE_ECC_KEY_PAIR`
function `psa_import_key` takes private key from key pair as argument.
This commit adds extraction of Private key from ECDSA key pair.

Also removes not needed `otPlatCryptoEcdsaGetPublicKey`.

Signed-off-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>
2024-01-23 10:02:17 +01:00
Damian Krolik 36b7a3e701 net: openthread: Remove PSA crypto backend workarounds
Remove two workarounds in OpenThread's PSA crypto backend
that were required when Zephyr used pre-1.5 TF-M version:
1. psa_open_key() is no longer needed to reference
   a persistent key
2. psa_cipher_encrypt() can be used to simplify AES
   encryption

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
2024-01-12 11:26:41 -06:00
Przemyslaw Bida 0018204091 net: openthread: Add new key and algorithm in PSA.
This commit adds new types of keys and algorithm to crypto_psa backend
of openthread.

Added options:
- `OT_CRYPTO_KEY_TYPE_ECDSA`
- `OT_CRYPTO_KEY_ALG_ECDSA`
- `OT_CRYPTO_KEY_USAGE_VERIFY_HASH`

Signed-off-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>
2024-01-11 15:40:55 -06:00
Maciej Baczmanski d2495b14f2 modules: openthread: fix unused variable during `otPlatCryptoInit`
If asserts are disabled, there is a warning in 'otPlatCryptoInit'
regarding unused variable `err`. This commit fixes that.

Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
2023-09-19 15:22:03 +01:00
Maciej Baczmanski be483d76d7 modules: openthread: initialize settings in `otPlatCryptoInit()`
In OpenThread, Settings are initialized after KeyManager by default.
If device uses PSA with emulated TFM, Settings have to be initialized
at the end of otPlatCryptoInit(), to be available before storing
Network Key.

Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
2023-08-28 14:27:53 +02:00
Arkadiusz Balys f16f1ae819 net: openthread: Initialize PSA crypto when random is initializing
The psa_generate_random function requires the psa_crypto_init call
before the usage. This can be ensured by calling the psa_crypto_init
in otPlatCryptoRandomInitfunction.

Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
2023-08-01 08:23:52 +00:00
Przemyslaw Bida f93613a245 net: openthread: Add implementation of crypto api.
This commit adds implementation of following new api functions from
openthread:
	- otPlatCryptoEcdsaGenerateAndImportKey
	- otPlatCryptoEcdsaExportPublicKey
	- otPlatCryptoEcdsaVerifyUsingKeyRef
	- otPlatCryptoEcdsaSignUsingKeyRef

Signed-off-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>
2023-05-11 12:10:25 +02:00
Eduardo Montoya 257df2e21c net: openthread: implement PSA support for ECDSA API
Implement the four new ECDSA platform functions required by OT.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2022-11-17 11:20:03 +01:00
Robert Lubos 815ebc316e net: openthread: Move glue code into module directory
Move OpenThread's glue code along with the Kconfig files that configure
OpenThread stack itself into module directory.

Update the maintainers file to reflect this change.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-07-11 11:00:12 +02:00