Skip to content

Commit f3704fc

Browse files
magnevrlubos
authored andcommitted
nrf_security: Support symmetric decryption with cracen key
Added switch case required for supporting platform fw encryption keys for cracen. Signed-off-by: Magne Værnes <[email protected]>
1 parent b09d646 commit f3704fc

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

subsys/nrf_security/src/psa_crypto_driver_wrappers.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -900,10 +900,14 @@ psa_status_t psa_driver_wrapper_cipher_decrypt(const psa_key_attributes_t *attri
900900
psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(attributes->lifetime);
901901

902902
switch (location) {
903-
case PSA_KEY_LOCATION_LOCAL_STORAGE:
903+
#if defined(PSA_NEED_CRACEN_CIPHER_DRIVER)
904+
case PSA_KEY_LOCATION_CRACEN:
905+
#endif
904906
#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
905907
case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
906-
#endif /* defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) */
908+
#endif
909+
case PSA_KEY_LOCATION_LOCAL_STORAGE:
910+
907911
/* Key is stored in the slot in export representation, so
908912
* cycle through all known transparent accelerators
909913
*/
@@ -1475,13 +1479,17 @@ psa_status_t psa_driver_wrapper_aead_decrypt(const psa_key_attributes_t *attribu
14751479
psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(attributes->lifetime);
14761480

14771481
switch (location) {
1478-
case PSA_KEY_LOCATION_LOCAL_STORAGE:
1482+
#if defined(PSA_NEED_CRACEN_AEAD_DRIVER)
1483+
case PSA_KEY_LOCATION_CRACEN:
1484+
#endif
14791485
#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
14801486
case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
1481-
#endif /* defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) */
1487+
#endif
14821488
#if defined(PSA_NEED_CRACEN_KMU_DRIVER)
14831489
case PSA_KEY_LOCATION_CRACEN_KMU:
14841490
#endif
1491+
case PSA_KEY_LOCATION_LOCAL_STORAGE:
1492+
14851493
/* Key is stored in the slot in export representation, so
14861494
* cycle through all known transparent accelerators
14871495
*/

0 commit comments

Comments
 (0)