25#if !defined(MBEDTLS_CONFIG_FILE)
26#include "mbedtls/config.h"
28#include MBEDTLS_CONFIG_FILE
34#define MBEDTLS_SHADOW_KEY_KDF_MAX_LABEL_SIZE_IN_BYTES (64)
35#define MBEDTLS_SHADOW_KEY_KDF_MAX_CONTEXT_SIZE_IN_BYTES (64)
36#define MBEDTLS_SHADOW_KEY_KDF_MAX_DERIVED_SIZE_IN_BYTES (4080)
39#define MBEDTLS_ERR_SHADOW_KEY_KEY_OK (0)
40#define MBEDTLS_ERR_SHADOW_KEY_INVALID_SLOT (-1)
41#define MBEDTLS_ERR_SHADOW_KEY_INVALID_SIZE (-2)
42#define MBEDTLS_ERR_SHADOW_KEY_KDF_INVALID_LABEL (-3)
43#define MBEDTLS_ERR_SHADOW_KEY_KDF_INVALID_CONTEXT (-4)
44#define MBEDTLS_ERR_SHADOW_KEY_KDF_INVALID_INPUT (-5)
45#define MBEDTLS_ERR_SHADOW_KEY_INTERNAL_ERROR (-6)
47#if defined(MBEDTLS_AES_C)
49#include "mbedtls/aes.h"
75 mbedtls_aes_context *
const ctx,
77 unsigned int keybits);
99 mbedtls_aes_context *
const ctx,
101 unsigned int keybits);
129 mbedtls_aes_context *
const ctx,
131 unsigned int keybits,
132 uint8_t
const * label,
134 uint8_t
const * context,
135 size_t context_size);
165 mbedtls_aes_context *
const ctx,
167 unsigned int keybits,
168 uint8_t
const * label,
170 uint8_t
const * context,
171 size_t context_size);
180#if defined(MBEDTLS_CCM_C)
182#include "mbedtls/ccm.h"
209 mbedtls_ccm_context *
const ctx,
210 mbedtls_cipher_id_t cipher,
244 mbedtls_ccm_context *
const ctx,
245 mbedtls_cipher_id_t cipher,
247 unsigned int keybits,
248 uint8_t
const * label,
250 uint8_t
const * context,
260#if defined(MBEDTLS_GCM_C)
262#include "mbedtls/gcm.h"
289 mbedtls_gcm_context *
const ctx,
290 mbedtls_cipher_id_t cipher,
324 mbedtls_gcm_context *
const ctx,
325 mbedtls_cipher_id_t cipher,
327 unsigned int keybits,
328 uint8_t
const * label,
330 uint8_t
const * context,
340#if defined(MBEDTLS_AES_C)
342#include "mbedtls/aes.h"
387 unsigned int keybits,
388 uint8_t
const * label,
390 uint8_t
const * context,
int mbedtls_aes_setkey_dec_shadow_key(mbedtls_aes_context *const ctx, uint32_t slot_id, unsigned int keybits)
Function to configure AES to use one or more KMU key slot for decryption.
int mbedtls_aes_setkey_dec_shadow_key_derived(mbedtls_aes_context *const ctx, uint32_t slot_id, unsigned int keybits, uint8_t const *label, size_t label_size, uint8_t const *context, size_t context_size)
Function to configure AES to use a key derived from one or more slots in KMU for decryption.
int mbedtls_ccm_setkey_shadow_key(mbedtls_ccm_context *const ctx, mbedtls_cipher_id_t cipher, uint32_t slot_id, unsigned int keybits)
Function to configure AES CCM to use one or more KMU key slot as encryption key.
int mbedtls_ccm_setkey_shadow_key_derived(mbedtls_ccm_context *const ctx, mbedtls_cipher_id_t cipher, uint32_t slot_id, unsigned int keybits, uint8_t const *label, size_t label_size, uint8_t const *context, size_t context_size)
Function to configure AES CCM to use a key derived from one or more slots in KMU for encryption.
int mbedtls_aes_setkey_enc_shadow_key(mbedtls_aes_context *const ctx, uint32_t slot_id, unsigned int keybits)
Function to configure AES to use one or more KMU key slot for encryption.
int mbedtls_gcm_setkey_shadow_key(mbedtls_gcm_context *const ctx, mbedtls_cipher_id_t cipher, uint32_t slot_id, unsigned int keybits)
Function to configure AES GCM to use one or more KMU key slot as encryption key.
int mbedtls_gcm_setkey_shadow_key_derived(mbedtls_gcm_context *const ctx, mbedtls_cipher_id_t cipher, uint32_t slot_id, unsigned int keybits, uint8_t const *label, size_t label_size, uint8_t const *context, size_t context_size)
Function to configure AES GCM to use a key derived from one or more slots in KMU for encryption.
int mbedtls_aes_setkey_enc_shadow_key_derived(mbedtls_aes_context *const ctx, uint32_t slot_id, unsigned int keybits, uint8_t const *label, size_t label_size, uint8_t const *context, size_t context_size)
Function to configure AES to use a key derived from one or more slots in KMU for encryption.
int mbedtls_shadow_key_derive(uint32_t slot_id, unsigned int keybits, uint8_t const *label, size_t label_size, uint8_t const *context, size_t context_size, uint8_t *output, size_t output_size)
Function to use CMAC to derive a key stored in KMU/Kdr.