ReactOS 0.4.16-dev-297-gc569aee
|
Entropy accumulator implementation. More...
Go to the source code of this file.
Classes | |
struct | mbedtls_entropy_source_state |
Entropy source state. More... | |
struct | mbedtls_entropy_context |
Entropy context structure. More... | |
Macros | |
#define | MBEDTLS_ENTROPY_SHA256_ACCUMULATOR |
#define | MBEDTLS_ERR_ENTROPY_SOURCE_FAILED -0x003C |
#define | MBEDTLS_ERR_ENTROPY_MAX_SOURCES -0x003E |
#define | MBEDTLS_ERR_ENTROPY_NO_SOURCES_DEFINED -0x0040 |
#define | MBEDTLS_ERR_ENTROPY_NO_STRONG_SOURCE -0x003D |
#define | MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR -0x003F |
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_ENTROPY_MAX_SOURCES 20 |
#define | MBEDTLS_ENTROPY_MAX_GATHER 128 |
#define | MBEDTLS_ENTROPY_BLOCK_SIZE 32 |
#define | MBEDTLS_ENTROPY_MAX_SEED_SIZE 1024 |
#define | MBEDTLS_ENTROPY_SOURCE_MANUAL MBEDTLS_ENTROPY_MAX_SOURCES |
#define | MBEDTLS_ENTROPY_SOURCE_STRONG 1 |
#define | MBEDTLS_ENTROPY_SOURCE_WEAK 0 |
typedef int(* | mbedtls_entropy_f_source_ptr) (void *data, unsigned char *output, size_t len, size_t *olen) |
Entropy poll callback pointer. | |
typedef struct mbedtls_entropy_source_state | mbedtls_entropy_source_state |
Entropy source state. | |
typedef struct mbedtls_entropy_context | mbedtls_entropy_context |
Entropy context structure. | |
void | mbedtls_entropy_init (mbedtls_entropy_context *ctx) |
Initialize the context. | |
void | mbedtls_entropy_free (mbedtls_entropy_context *ctx) |
Free the data in the context. | |
int | mbedtls_entropy_add_source (mbedtls_entropy_context *ctx, mbedtls_entropy_f_source_ptr f_source, void *p_source, size_t threshold, int strong) |
Adds an entropy source to poll (Thread-safe if MBEDTLS_THREADING_C is enabled) | |
int | mbedtls_entropy_gather (mbedtls_entropy_context *ctx) |
Trigger an extra gather poll for the accumulator (Thread-safe if MBEDTLS_THREADING_C is enabled) | |
int | mbedtls_entropy_func (void *data, unsigned char *output, size_t len) |
Retrieve entropy from the accumulator (Maximum length: MBEDTLS_ENTROPY_BLOCK_SIZE) (Thread-safe if MBEDTLS_THREADING_C is enabled) | |
int | mbedtls_entropy_update_manual (mbedtls_entropy_context *ctx, const unsigned char *data, size_t len) |
Add data to the accumulator manually (Thread-safe if MBEDTLS_THREADING_C is enabled) | |
Entropy accumulator implementation.
Definition in file entropy.h.
#define MBEDTLS_ENTROPY_BLOCK_SIZE 32 |
#define MBEDTLS_ENTROPY_MAX_GATHER 128 |
#define MBEDTLS_ENTROPY_MAX_SEED_SIZE 1024 |
#define MBEDTLS_ENTROPY_MAX_SOURCES 20 |
#define MBEDTLS_ENTROPY_SOURCE_MANUAL MBEDTLS_ENTROPY_MAX_SOURCES |
#define MBEDTLS_ENTROPY_SOURCE_STRONG 1 |
#define MBEDTLS_ENTROPY_SOURCE_WEAK 0 |
#define MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR -0x003F |
#define MBEDTLS_ERR_ENTROPY_MAX_SOURCES -0x003E |
#define MBEDTLS_ERR_ENTROPY_NO_SOURCES_DEFINED -0x0040 |
#define MBEDTLS_ERR_ENTROPY_NO_STRONG_SOURCE -0x003D |
#define MBEDTLS_ERR_ENTROPY_SOURCE_FAILED -0x003C |
Entropy context structure.
typedef int(* mbedtls_entropy_f_source_ptr) (void *data, unsigned char *output, size_t len, size_t *olen) |
Entropy poll callback pointer.
data | Callback-specific data pointer |
output | Data to fill |
len | Maximum size to provide |
olen | The actual amount of bytes put into the buffer (Can be 0) |
Entropy source state.
int mbedtls_entropy_add_source | ( | mbedtls_entropy_context * | ctx, |
mbedtls_entropy_f_source_ptr | f_source, | ||
void * | p_source, | ||
size_t | threshold, | ||
int | strong | ||
) |
Adds an entropy source to poll (Thread-safe if MBEDTLS_THREADING_C is enabled)
ctx | Entropy context |
f_source | Entropy function |
p_source | Function data |
threshold | Minimum required from source before entropy is released ( with mbedtls_entropy_func() ) (in bytes) |
strong | MBEDTLS_ENTROPY_SOURCE_STRONG or MBEDTLS_ENTROPY_SOURCE_WEAK. At least one strong source needs to be added. Weaker sources (such as the cycle counter) can be used as a complement. |
void mbedtls_entropy_free | ( | mbedtls_entropy_context * | ctx | ) |
Free the data in the context.
ctx | Entropy context to free |
Retrieve entropy from the accumulator (Maximum length: MBEDTLS_ENTROPY_BLOCK_SIZE) (Thread-safe if MBEDTLS_THREADING_C is enabled)
data | Entropy context |
output | Buffer to fill |
len | Number of bytes desired, must be at most MBEDTLS_ENTROPY_BLOCK_SIZE |
int mbedtls_entropy_gather | ( | mbedtls_entropy_context * | ctx | ) |
Trigger an extra gather poll for the accumulator (Thread-safe if MBEDTLS_THREADING_C is enabled)
ctx | Entropy context |
void mbedtls_entropy_init | ( | mbedtls_entropy_context * | ctx | ) |
Initialize the context.
ctx | Entropy context to initialize |