PRNG for side-channel analysis. More...
Go to the source code of this file.
Functions | |
void | prng_seed (uint32_t seed) |
Initializes the random number generator. More... | |
uint32_t | prng_rand_uint32 (void) |
Generates a random uint32_t. More... | |
uint8_t | prng_rand_byte (void) |
Generates a random byte. More... | |
void | prng_rand_bytes (uint8_t *buffer, size_t buffer_len) |
Fills a buffer with random bytes. More... | |
PRNG for side-channel analysis.
This library provides a Mersenne Twister PRNG that can be used to generate random plaintexts on the device. Generating random plaintexts on the device eliminates the overhead of sending them from the host and can significantly improve capture rate. The host must use the same PRNG to be able to compute the plaintext and the ciphertext of each trace.
TODO(alphan): Replace this with a more efficient PRNG after updating host-side code.
Definition in file prng.h.
uint8_t prng_rand_byte | ( | void | ) |
void prng_rand_bytes | ( | uint8_t * | buffer, |
size_t | buffer_len | ||
) |
uint32_t prng_rand_uint32 | ( | void | ) |
void prng_seed | ( | uint32_t | seed | ) |
Initializes the random number generator.
seed | Seed to initalize with. |
Initializes the random number generator.
TODO(alphan): Using MT for now as a proof of concept to minimize host-side changes. We should probably replace this with a PRNG from xoshiro* family for PRNGs, e.g. xoshiro128++, for better performance and less overhead.