Mbed OS Reference
Loading...
Searching...
No Matches
hmac_drbg.h File Reference

The HMAC_DRBG pseudorandom generator. More...

#include "mbedtls/config.h"
#include "mbedtls/md.h"

Go to the source code of this file.

Data Structures

struct  mbedtls_hmac_drbg_context
 HMAC_DRBG context. More...
 

Macros

#define MBEDTLS_ERR_HMAC_DRBG_REQUEST_TOO_BIG   -0x0003
 Too many random requested in single call. More...
 
#define MBEDTLS_ERR_HMAC_DRBG_INPUT_TOO_BIG   -0x0005
 Input too large (Entropy + additional). More...
 
#define MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR   -0x0007
 Read/write error in file. More...
 
#define MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED   -0x0009
 The entropy source failed. More...
 
#define MBEDTLS_HMAC_DRBG_PR_OFF   0
 No prediction resistance
More...
 
#define MBEDTLS_HMAC_DRBG_PR_ON   1
 Prediction resistance enabled
More...
 
SECTION: Module settings

The configuration options you can set for this module are in this section.

Either change them in config.h or define them on the compiler command line.

#define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL   10000
 Interval before reseed is performed by default. More...
 
#define MBEDTLS_HMAC_DRBG_MAX_INPUT   256
 Maximum number of additional input bytes. More...
 
#define MBEDTLS_HMAC_DRBG_MAX_REQUEST   1024
 Maximum number of requested bytes per call. More...
 
#define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT   384
 Maximum size of (re)seed buffer. More...
 

Typedefs

typedef struct mbedtls_hmac_drbg_context mbedtls_hmac_drbg_context
 HMAC_DRBG context. More...
 

Functions

void mbedtls_hmac_drbg_init (mbedtls_hmac_drbg_context *ctx)
 HMAC_DRBG context initialization. More...
 
int mbedtls_hmac_drbg_seed (mbedtls_hmac_drbg_context *ctx, const mbedtls_md_info_t *md_info, int(*f_entropy)(void *, unsigned char *, size_t), void *p_entropy, const unsigned char *custom, size_t len)
 HMAC_DRBG initial seeding. More...
 
int mbedtls_hmac_drbg_seed_buf (mbedtls_hmac_drbg_context *ctx, const mbedtls_md_info_t *md_info, const unsigned char *data, size_t data_len)
 Initilisation of simpified HMAC_DRBG (never reseeds). More...
 
void mbedtls_hmac_drbg_set_prediction_resistance (mbedtls_hmac_drbg_context *ctx, int resistance)
 This function turns prediction resistance on or off. More...
 
void mbedtls_hmac_drbg_set_entropy_len (mbedtls_hmac_drbg_context *ctx, size_t len)
 This function sets the amount of entropy grabbed on each seed or reseed. More...
 
void mbedtls_hmac_drbg_set_reseed_interval (mbedtls_hmac_drbg_context *ctx, int interval)
 Set the reseed interval. More...
 
int mbedtls_hmac_drbg_update_ret (mbedtls_hmac_drbg_context *ctx, const unsigned char *additional, size_t add_len)
 This function updates the state of the HMAC_DRBG context. More...
 
int mbedtls_hmac_drbg_reseed (mbedtls_hmac_drbg_context *ctx, const unsigned char *additional, size_t len)
 This function reseeds the HMAC_DRBG context, that is extracts data from the entropy source. More...
 
int mbedtls_hmac_drbg_random_with_add (void *p_rng, unsigned char *output, size_t output_len, const unsigned char *additional, size_t add_len)
 This function updates an HMAC_DRBG instance with additional data and uses it to generate random data. More...
 
int mbedtls_hmac_drbg_random (void *p_rng, unsigned char *output, size_t out_len)
 This function uses HMAC_DRBG to generate random data. More...
 
void mbedtls_hmac_drbg_free (mbedtls_hmac_drbg_context *ctx)
 This function resets HMAC_DRBG context to the state immediately after initial call of mbedtls_hmac_drbg_init(). More...
 
void mbedtls_hmac_drbg_update (mbedtls_hmac_drbg_context *ctx, const unsigned char *additional, size_t add_len)
 This function updates the state of the HMAC_DRBG context. More...
 

Detailed Description

The HMAC_DRBG pseudorandom generator.

This module implements the HMAC_DRBG pseudorandom generator described in NIST SP 800-90A: Recommendation for Random Number Generation Using Deterministic Random Bit Generators.

Definition in file hmac_drbg.h.