Go to the documentation of this file.
27 #ifndef POLARSSL_CTR_DRBG_H
28 #define POLARSSL_CTR_DRBG_H
34 #define POLARSSL_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED -0x0034
35 #define POLARSSL_ERR_CTR_DRBG_REQUEST_TOO_BIG -0x0036
36 #define POLARSSL_ERR_CTR_DRBG_INPUT_TOO_BIG -0x0038
37 #define POLARSSL_ERR_CTR_DRBG_FILE_IO_ERROR -0x003A
39 #define CTR_DRBG_BLOCKSIZE 16
40 #define CTR_DRBG_KEYSIZE 32
41 #define CTR_DRBG_KEYBITS ( CTR_DRBG_KEYSIZE * 8 )
42 #define CTR_DRBG_SEEDLEN ( CTR_DRBG_KEYSIZE + CTR_DRBG_BLOCKSIZE )
45 #if !defined(POLARSSL_CONFIG_OPTIONS)
46 #if defined(POLARSSL_SHA512_C)
47 #define CTR_DRBG_ENTROPY_LEN 48
49 #define CTR_DRBG_ENTROPY_LEN 32
51 #define CTR_DRBG_RESEED_INTERVAL 10000
52 #define CTR_DRBG_MAX_INPUT 256
53 #define CTR_DRBG_MAX_REQUEST 1024
54 #define CTR_DRBG_MAX_SEED_INPUT 384
57 #define CTR_DRBG_PR_OFF 0
58 #define CTR_DRBG_PR_ON 1
69 unsigned char counter[16];
71 int prediction_resistance;
81 int (*f_entropy)(
void *,
unsigned char *, size_t);
105 int (*f_entropy)(
void *,
unsigned char *,
size_t),
107 const unsigned char *custom,
153 const unsigned char *additional,
size_t len );
163 const unsigned char *additional,
size_t add_len );
181 unsigned char *output,
size_t output_len,
182 const unsigned char *additional,
size_t add_len );
198 unsigned char *output,
size_t output_len );
200 #if defined(POLARSSL_FS_IO)