nrfxlib API 3.3.99
Loading...
Searching...
No Matches
nrf_cc3xx_platform_shadow_key.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
13#include <stdint.h>
14
15#ifndef NRF_CC3XX_PLATFORM_SHADOW_KEY__
16#define NRF_CC3XX_PLATFORM_SHADOW_KEY__
17
18#define NRF_CC3XX_SHADOW_KEY_MAX_INPLACE_CHUNK_SIZE (512)
19#define NRF_CC3XX_SHADOW_AEAD_CONTEXT_SIZE_WORDS (66)
20
25
33
35typedef struct{
36 uint32_t slot_id;
37 size_t key_size;
38 uint8_t const *label;
39 size_t label_size;
41
53
54
66 uint32_t slot_id,
67 unsigned int deriv_key_size,
68 uint8_t const * label,
69 size_t label_size);
70
87 const uint8_t * nonce,
88 size_t nonce_size,
89 const uint8_t * aad,
90 size_t aad_size,
91 size_t plaintext_size);
92
93
106 uint8_t const * input,
107 size_t input_size,
108 uint8_t * output,
109 size_t output_size,
110 size_t * output_length);
111
129 uint8_t * output,
130 size_t output_size,
131 size_t *output_length,
132 uint8_t * tag,
133 size_t tag_size,
134 size_t *tag_length);
135
136
137#endif /* NRF_CC3XX_PLATFORM_SHADOW_KEY__ */
nrf_cc3xx_platform_shadow_key_enc_mode_t
Definition nrf_cc3xx_platform_shadow_key.h:21
@ MODE_ENCRYPT
Definition nrf_cc3xx_platform_shadow_key.h:22
@ MODE_DECRYPT
Definition nrf_cc3xx_platform_shadow_key.h:23
nrf_cc3xx_platform_shadow_key_enc_cipher_t
Enum with the encryption/decryption algorithms supported with derived keys.
Definition nrf_cc3xx_platform_shadow_key.h:27
@ ALG_AES_256_BIT
Definition nrf_cc3xx_platform_shadow_key.h:29
@ ALG_CHACHA20_256_BIT
Definition nrf_cc3xx_platform_shadow_key.h:30
@ ALG_AES_128_BIT
Definition nrf_cc3xx_platform_shadow_key.h:28
@ ALG_CHACHAPOLY_256_BIT
Definition nrf_cc3xx_platform_shadow_key.h:31
int nrf_cc3xx_platform_shadow_key_crypt_finish(nrf_cc3xx_platform_shadow_key_ctx_t *ctx, uint8_t *output, size_t output_size, size_t *output_length, uint8_t *tag, size_t tag_size, size_t *tag_length)
Function to finalize the encryption/decryption operation.
int nrf_cc3xx_platform_shadow_key_crypt_setup(nrf_cc3xx_platform_shadow_key_ctx_t *ctx, nrf_cc3xx_platform_shadow_key_enc_cipher_t cipher, nrf_cc3xx_platform_shadow_key_enc_mode_t mode, const uint8_t *nonce, size_t nonce_size, const uint8_t *aad, size_t aad_size, size_t plaintext_size)
Function to setup the encryption/decryption operation.
int nrf_cc3xx_platform_shadow_key_crypt_update(nrf_cc3xx_platform_shadow_key_ctx_t *ctx, uint8_t const *input, size_t input_size, uint8_t *output, size_t output_size, size_t *output_length)
Function to encrypt/decrypt data using a derived key.
#define NRF_CC3XX_SHADOW_AEAD_CONTEXT_SIZE_WORDS
Definition nrf_cc3xx_platform_shadow_key.h:19
int nrf_cc3xx_platform_shadow_key_init(nrf_cc3xx_platform_shadow_key_ctx_t *ctx, uint32_t slot_id, unsigned int deriv_key_size, uint8_t const *label, size_t label_size)
Function to initialize the derived key context.
nrf_cc3xx_platform_shadow_key_enc_mode_t mode
Definition nrf_cc3xx_platform_shadow_key.h:45
size_t state
Definition nrf_cc3xx_platform_shadow_key.h:44
nrf_cc3xx_platform_shadow_key_derivation_info_t deriv_info
Definition nrf_cc3xx_platform_shadow_key.h:46
nrf_cc3xx_platform_shadow_key_enc_cipher_t enc_cipher
Definition nrf_cc3xx_platform_shadow_key.h:47
Derived key context.
Definition nrf_cc3xx_platform_shadow_key.h:43
uint32_t slot_id
Definition nrf_cc3xx_platform_shadow_key.h:36
uint8_t const * label
Definition nrf_cc3xx_platform_shadow_key.h:38
size_t key_size
Definition nrf_cc3xx_platform_shadow_key.h:37
size_t label_size
Definition nrf_cc3xx_platform_shadow_key.h:39
Structure containing information for doing the key derivation using AES CMAC.
Definition nrf_cc3xx_platform_shadow_key.h:35