nrfxlib API 3.3.99
Loading...
Searching...
No Matches
nrf_cc3xx_platform_ctr_drbg.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
19#ifndef NRF_CC3XX_PLATFORM_CTR_DRBG_H__
20#define NRF_CC3XX_PLATFORM_CTR_DRBG_H__
21
22#include <stdint.h>
23#include <stdbool.h>
24#include <stddef.h>
25
27
28#ifdef __cplusplus
29extern "C"
30{
31#endif
32
39#define NRF_CC3XX_PLATFORM_ENTROPY_SIZE_WORDS (78)
40
52
53
70 const uint8_t * pers_string,
71 size_t pers_string_len);
72
73
81
82
106 bool pr_enabled);
107
108
128 nrf_cc3xx_platform_ctr_drbg_context_t * const context, int interval);
129
130
161 const uint8_t *additional,
162 size_t add_len);
163
164
197 uint8_t *buffer,
198 size_t len,
199 size_t *olen,
200 const uint8_t *additional,
201 size_t add_len);
202
203
230 uint8_t *buffer,
231 size_t length,
232 size_t* olen);
233
234#ifdef __cplusplus
235}
236#endif
237
238#endif /* NRF_CC3XX_PLATFORM_CTR_DRBG_H__ */
239
int nrf_cc3xx_platform_ctr_drbg_set_reseed_interval(nrf_cc3xx_platform_ctr_drbg_context_t *const context, int interval)
Function to change the reseed interval.
#define NRF_CC3XX_PLATFORM_ENTROPY_SIZE_WORDS
Macro holding size of the opaque ctr_drbg context type.
Definition nrf_cc3xx_platform_ctr_drbg.h:39
int nrf_cc3xx_platform_ctr_drbg_get_with_add(nrf_cc3xx_platform_ctr_drbg_context_t *const context, uint8_t *buffer, size_t len, size_t *olen, const uint8_t *additional, size_t add_len)
Function to get PRNG using ctr_drbg and an additional string of data.
int nrf_cc3xx_platform_ctr_drbg_reseed(nrf_cc3xx_platform_ctr_drbg_context_t *const context, const uint8_t *additional, size_t add_len)
Function to do a manual reseed of ctr_drbg (using TRNG)
int nrf_cc3xx_platform_ctr_drbg_set_pr(nrf_cc3xx_platform_ctr_drbg_context_t *const context, bool pr_enabled)
Function to enable prediction resistance.
int nrf_cc3xx_platform_ctr_drbg_get(nrf_cc3xx_platform_ctr_drbg_context_t *const context, uint8_t *buffer, size_t length, size_t *olen)
Function to get PRNG data using ctr_drbg.
int nrf_cc3xx_platform_ctr_drbg_free(nrf_cc3xx_platform_ctr_drbg_context_t *const context)
Function that deintializes a ctr_drbg context.
int nrf_cc3xx_platform_ctr_drbg_init(nrf_cc3xx_platform_ctr_drbg_context_t *const context, const uint8_t *pers_string, size_t pers_string_len)
Function that initializes a ctr_drbg context.
uint32_t is_initialized
Mask indicating if the ctr_drbg context has been initialized.
Definition nrf_cc3xx_platform_ctr_drbg.h:48
uint32_t reseed_interval
The reseed interval.
Definition nrf_cc3xx_platform_ctr_drbg.h:50
uint32_t buffer[(78)]
Internal buffer for the built-in entropy and ctrl_drbg contexts.
Definition nrf_cc3xx_platform_ctr_drbg.h:49
Opaque type for the context required for ctr_drbg generation.
Definition nrf_cc3xx_platform_ctr_drbg.h:47