nrfxlib API
3.3.99
Loading...
Searching...
No Matches
nrf_cc3xx_platform_derived_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_DERIVED_KEY__
16
#define NRF_CC3XX_PLATFORM_DERIVED_KEY__
17
19
typedef
enum
{
20
ALG_AES_128_BIT
= 1,
21
ALG_AES_256_BIT
= 2,
22
ALG_CHACHA20_256_BIT
= 3,
23
ALG_CHACHAPOLY_256_BIT
= 3
/* Intentionally the same as CHACHA20 */
24
}
nrf_cc3xx_platform_cipher_info_t
;
25
27
typedef
struct
{
28
uint32_t
slot_id
;
29
size_t
key_size
;
30
const
uint8_t *
label
;
31
size_t
label_size
;
32
const
uint8_t *
context
;
33
size_t
context_size
;
34
}
nrf_cc3xx_platform_derivation_info_t
;
35
37
typedef
struct
{
38
const
uint8_t *
nonce
;
39
size_t
nonce_size
;
40
const
uint8_t *
aad
;
41
size_t
aad_size
;
42
uint8_t *
tag
;
43
size_t
tag_size
;
45
}
nrf_cc3xx_platform_auth_info_t
;
46
48
typedef
struct
{
49
nrf_cc3xx_platform_derivation_info_t
deriv_info
;
50
nrf_cc3xx_platform_cipher_info_t
cipher_info
;
51
nrf_cc3xx_platform_auth_info_t
auth_info
;
52
size_t
state
;
53
}
nrf_cc3xx_platform_derived_key_ctx_t
;
54
61
int
nrf_cc3xx_platform_derived_key_init
(
nrf_cc3xx_platform_derived_key_ctx_t
* ctx);
62
63
74
int
nrf_cc3xx_platform_derived_key_set_info
(
nrf_cc3xx_platform_derived_key_ctx_t
* ctx,
75
uint32_t slot_id,
76
unsigned
int
key_size,
77
uint8_t
const
* label,
78
size_t
label_size);
79
80
88
int
nrf_cc3xx_platform_derived_key_set_cipher
(
nrf_cc3xx_platform_derived_key_ctx_t
* ctx,
89
nrf_cc3xx_platform_cipher_info_t
cipher_info);
90
103
int
nrf_cc3xx_platform_derived_key_set_auth_info
(
nrf_cc3xx_platform_derived_key_ctx_t
* ctx,
104
const
uint8_t * nonce,
105
size_t
nonce_size,
106
const
uint8_t * aad,
107
size_t
aad_size,
108
uint8_t * tag,
109
size_t
tag_size);
110
111
123
int
nrf_cc3xx_platform_derived_key_encrypt
(
nrf_cc3xx_platform_derived_key_ctx_t
* ctx,
124
uint8_t * output,
125
size_t
input_size,
126
uint8_t
const
* input);
127
128
140
int
nrf_cc3xx_platform_derived_key_decrypt
(
nrf_cc3xx_platform_derived_key_ctx_t
* ctx,
141
uint8_t * output,
142
size_t
input_size,
143
uint8_t
const
* input);
144
145
#endif
/* NRF_CC3XX_PLATFORM_DERIVED_KEY__ */
nrf_cc3xx_platform_derived_key_encrypt
int nrf_cc3xx_platform_derived_key_encrypt(nrf_cc3xx_platform_derived_key_ctx_t *ctx, uint8_t *output, size_t input_size, uint8_t const *input)
Function to encrypt data using a derived key.
nrf_cc3xx_platform_derived_key_set_auth_info
int nrf_cc3xx_platform_derived_key_set_auth_info(nrf_cc3xx_platform_derived_key_ctx_t *ctx, const uint8_t *nonce, size_t nonce_size, const uint8_t *aad, size_t aad_size, uint8_t *tag, size_t tag_size)
Function to set the authenticated encryption information.
nrf_cc3xx_platform_cipher_info_t
nrf_cc3xx_platform_cipher_info_t
Enum with the encryption/decryption algorithms supported with derived keys.
Definition
nrf_cc3xx_platform_derived_key.h:19
ALG_AES_256_BIT
@ ALG_AES_256_BIT
Definition
nrf_cc3xx_platform_derived_key.h:21
ALG_CHACHA20_256_BIT
@ ALG_CHACHA20_256_BIT
Definition
nrf_cc3xx_platform_derived_key.h:22
ALG_AES_128_BIT
@ ALG_AES_128_BIT
Definition
nrf_cc3xx_platform_derived_key.h:20
ALG_CHACHAPOLY_256_BIT
@ ALG_CHACHAPOLY_256_BIT
Definition
nrf_cc3xx_platform_derived_key.h:23
nrf_cc3xx_platform_derived_key_set_info
int nrf_cc3xx_platform_derived_key_set_info(nrf_cc3xx_platform_derived_key_ctx_t *ctx, uint32_t slot_id, unsigned int key_size, uint8_t const *label, size_t label_size)
Function to set the key derivation information.
nrf_cc3xx_platform_derived_key_decrypt
int nrf_cc3xx_platform_derived_key_decrypt(nrf_cc3xx_platform_derived_key_ctx_t *ctx, uint8_t *output, size_t input_size, uint8_t const *input)
Function to decrypt data using a derived key.
nrf_cc3xx_platform_derived_key_set_cipher
int nrf_cc3xx_platform_derived_key_set_cipher(nrf_cc3xx_platform_derived_key_ctx_t *ctx, nrf_cc3xx_platform_cipher_info_t cipher_info)
Function to set the derived cipher.
nrf_cc3xx_platform_derived_key_init
int nrf_cc3xx_platform_derived_key_init(nrf_cc3xx_platform_derived_key_ctx_t *ctx)
Function to initialize the derived key context.
nrf_cc3xx_platform_auth_info_t::aad_size
size_t aad_size
Definition
nrf_cc3xx_platform_derived_key.h:41
nrf_cc3xx_platform_auth_info_t::nonce
const uint8_t * nonce
Definition
nrf_cc3xx_platform_derived_key.h:38
nrf_cc3xx_platform_auth_info_t::tag_size
size_t tag_size
Definition
nrf_cc3xx_platform_derived_key.h:43
nrf_cc3xx_platform_auth_info_t::tag
uint8_t * tag
Definition
nrf_cc3xx_platform_derived_key.h:42
nrf_cc3xx_platform_auth_info_t::nonce_size
size_t nonce_size
Definition
nrf_cc3xx_platform_derived_key.h:39
nrf_cc3xx_platform_auth_info_t::aad
const uint8_t * aad
Definition
nrf_cc3xx_platform_derived_key.h:40
nrf_cc3xx_platform_auth_info_t
Authenticated encryption/decryption info.
Definition
nrf_cc3xx_platform_derived_key.h:37
nrf_cc3xx_platform_derivation_info_t::label
const uint8_t * label
Definition
nrf_cc3xx_platform_derived_key.h:30
nrf_cc3xx_platform_derivation_info_t::key_size
size_t key_size
Definition
nrf_cc3xx_platform_derived_key.h:29
nrf_cc3xx_platform_derivation_info_t::context
const uint8_t * context
Definition
nrf_cc3xx_platform_derived_key.h:32
nrf_cc3xx_platform_derivation_info_t::label_size
size_t label_size
Definition
nrf_cc3xx_platform_derived_key.h:31
nrf_cc3xx_platform_derivation_info_t::context_size
size_t context_size
Definition
nrf_cc3xx_platform_derived_key.h:33
nrf_cc3xx_platform_derivation_info_t::slot_id
uint32_t slot_id
Definition
nrf_cc3xx_platform_derived_key.h:28
nrf_cc3xx_platform_derivation_info_t
Structure containing information for doing the key derivation using AES CMAC.
Definition
nrf_cc3xx_platform_derived_key.h:27
nrf_cc3xx_platform_derived_key_ctx_t::auth_info
nrf_cc3xx_platform_auth_info_t auth_info
Definition
nrf_cc3xx_platform_derived_key.h:51
nrf_cc3xx_platform_derived_key_ctx_t::cipher_info
nrf_cc3xx_platform_cipher_info_t cipher_info
Definition
nrf_cc3xx_platform_derived_key.h:50
nrf_cc3xx_platform_derived_key_ctx_t::deriv_info
nrf_cc3xx_platform_derivation_info_t deriv_info
Definition
nrf_cc3xx_platform_derived_key.h:49
nrf_cc3xx_platform_derived_key_ctx_t::state
size_t state
Definition
nrf_cc3xx_platform_derived_key.h:52
nrf_cc3xx_platform_derived_key_ctx_t
Derived key context.
Definition
nrf_cc3xx_platform_derived_key.h:48
crypto
nrf_cc310_platform
include
nrf_cc3xx_platform_derived_key.h
Generated on Wed Jun 10 2026 17:21:22 for nrfxlib API by
1.12.0