Botan 2.17.3
Crypto and TLS for C&
|
#include <botan/ffi.h>
#include <botan/internal/ffi_util.h>
#include <botan/internal/ffi_rng.h>
#include <botan/system_rng.h>
#include <botan/auto_rng.h>
Go to the source code of this file.
Functions | |
int | botan_rng_add_entropy (botan_rng_t rng, const uint8_t *input, size_t len) |
int | botan_rng_destroy (botan_rng_t rng) |
int | botan_rng_get (botan_rng_t rng, uint8_t *out, size_t out_len) |
int | botan_rng_init (botan_rng_t *rng_out, const char *rng_type) |
int | botan_rng_reseed (botan_rng_t rng, size_t bits) |
int | botan_rng_reseed_from_rng (botan_rng_t rng, botan_rng_t source_rng, size_t bits) |
int botan_rng_add_entropy | ( | botan_rng_t | rng, |
const uint8_t * | entropy, | ||
size_t | entropy_len | ||
) |
Add some seed material to a random number generator
rng | rng object |
entropy | the data to add |
entropy_len | length of entropy buffer |
Definition at line 75 of file ffi_rng.cpp.
References Botan::RandomNumberGenerator::add_entropy(), and BOTAN_FFI_DO.
int botan_rng_destroy | ( | botan_rng_t | rng | ) |
Frees all resources of the random number generator object
rng | rng object |
Definition at line 60 of file ffi_rng.cpp.
References BOTAN_FFI_CHECKED_DELETE.
int botan_rng_get | ( | botan_rng_t | rng, |
uint8_t * | out, | ||
size_t | out_len | ||
) |
Get random bytes from a random number generator
rng | rng object |
out | output buffer of size out_len |
out_len | number of requested bytes |
Definition at line 65 of file ffi_rng.cpp.
References BOTAN_FFI_DO, and Botan::RandomNumberGenerator::randomize().
int botan_rng_init | ( | botan_rng_t * | rng, |
const char * | rng_type | ||
) |
Initialize a random number generator object
rng | rng object |
rng_type | type of the rng, possible values: "system": system RNG "user": userspace RNG "user-threadsafe": userspace RNG, with internal locking "rdrand": directly read RDRAND Set rng_type to null to let the library choose some default. |
Definition at line 21 of file ffi_rng.cpp.
References Botan::Processor_RNG::available(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, and Botan_FFI::ffi_guard_thunk().
int botan_rng_reseed | ( | botan_rng_t | rng, |
size_t | bits | ||
) |
Reseed a random number generator Uses the System_RNG as a seed generator.
rng | rng object |
bits | number of bits to to reseed with |
Definition at line 70 of file ffi_rng.cpp.
References BOTAN_FFI_DO, Botan::RandomNumberGenerator::reseed_from_rng(), and Botan::system_rng().
int botan_rng_reseed_from_rng | ( | botan_rng_t | rng, |
botan_rng_t | source_rng, | ||
size_t | bits | ||
) |
Reseed a random number generator
rng | rng object |
source_rng | the rng that will be read from |
bits | number of bits to to reseed with |
Definition at line 80 of file ffi_rng.cpp.
References BOTAN_FFI_DO, Botan::RandomNumberGenerator::reseed_from_rng(), and Botan_FFI::safe_get().