nrfxlib API 3.3.99
Loading...
Searching...
No Matches

◆ nrf_cc3xx_platform_kmu_write_key_slot()

int nrf_cc3xx_platform_kmu_write_key_slot ( uint32_t slot_id,
uint32_t key_addr,
uint32_t key_perm,
const uint8_t key[16] )

#include <crypto/nrf_cc310_platform/include/nrf_cc3xx_platform_kmu.h>

Write a 128 bit key into a KMU slot.

This writes a key to KMU with the destination of the subsequent push operation set to the address of the AES or ChaChaPoly key registers in Arm CryptoCell.

Note
The default mask for permissions is recommended to use. Please see NRF_CC3XX_PLATFORM_KMU_DEFAULT_PERMISSIONS.
AES keys of 128 bits can use NRF_CC3XX_PLATFORM_KMU_AES_ADDR as the key_addr. ChaChaPoly keys of 128 bits can use NRF_CC3XX_PLATFORM_KMU_CHACHAPOLY_ADDR as the key addr. Keys larger than 128 bits must be split up to use two KMU slots. For AES (only applicable to nRF5340): Use NRF_CC3XX_PLATFORM_KMU_AES_ADDR_1 for the first 128 bits of the key. Use NRF_CC3XX_PLATFORM_KMU_AES_ADDR_2 for the subsequent bits of the key. For ChaChaPoly: Use NRF_CC3XX_PLATFORM_KMU_CHACHAPOLY_ADDR_1 for the first 128 bits of the key. Use NRF_CC3XX_PLATFORM_KMU_CHACHAPOLY_ADDR_2 for the subsequent bits of the key.
Parameters
[in]slot_idKMU slot ID for the new key (2 - 127).
[in]key_addrDestination address in CryptoCell used for key push.
[in]key_permPermissions to set for the KMU slot.
[in]keyArray with the 128 bit key to put in the KMU slot.
Returns
NRF_CC3XX_PLATFORM_SUCCESS on success, otherwise a negative value.