drbg-aes

drbg-aes

Functions

Types and Values

Description

Functions

INCREMENT()

#define             INCREMENT(size, ctr)

drbg_aes_init ()

int
drbg_aes_init (struct drbg_aes_ctx *ctx,
               unsigned  entropy_size,
               const uint8_t *entropy,
               unsigned  pstring_size,
               const uint8_t *pstring);

drbg_aes_reseed ()

int
drbg_aes_reseed (struct drbg_aes_ctx *ctx,
                 unsigned  entropy_size,
                 const uint8_t *entropy,
                 unsigned  add_size,
                 const uint8_t *add);

drbg_aes_random ()

int
drbg_aes_random (struct drbg_aes_ctx *ctx,
                 unsigned  length,
                 uint8_t *dst);

drbg_aes_generate ()

int
drbg_aes_generate (struct drbg_aes_ctx *ctx,
                   unsigned  length,
                   uint8_t *dst,
                   unsigned  add_size,
                   const uint8_t *add);

drbg_aes_is_seeded ()

int
drbg_aes_is_seeded (struct drbg_aes_ctx *ctx);

drbg_aes_self_test ()

int
drbg_aes_self_test (void);

Types and Values

DRBG_AES_KEY_SIZE

#define DRBG_AES_KEY_SIZE AES256_KEY_SIZE

DRBG_AES_SEED_SIZE

#define DRBG_AES_SEED_SIZE (AES_BLOCK_SIZE+DRBG_AES_KEY_SIZE)

struct drbg_aes_ctx

struct drbg_aes_ctx {
	unsigned seeded;
	/* The current key */
	struct aes256_ctx key;

	uint8_t v[AES_BLOCK_SIZE];

	unsigned reseed_counter;
};

MAX_DRBG_AES_GENERATE_SIZE

#define MAX_DRBG_AES_GENERATE_SIZE 65536 /* 2^19 */

DRBG_AES_RESEED_TIME

#define DRBG_AES_RESEED_TIME 16777216