Lightweight Cryptography Primitives
 All Data Structures Files Functions Variables Typedefs Macros Pages
aead-random.h
Go to the documentation of this file.
1 /*
2  * This file has been placed into the public domain by Rhys Weatherley.
3  * It can be reused and modified as necessary. It may even be completely
4  * thrown away and replaced with a different system-specific implementation
5  * that provides the same API.
6  */
7 
8 #ifndef LWCRYPTO_AEAD_RANDOM_H
9 #define LWCRYPTO_AEAD_RANDOM_H
10 
11 #include <stdint.h>
12 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
26 void aead_random_init(void);
27 
34 void aead_random_finish(void);
35 
41 uint32_t aead_random_generate_32(void);
42 
48 uint64_t aead_random_generate_64(void);
49 
56 void aead_random_generate(void *buffer, unsigned size);
57 
66 void aead_random_reseed(void);
67 
77 void aead_random_set_seed(const unsigned char seed[32]);
78 
79 #ifdef __cplusplus
80 }
81 #endif
82 
83 #endif
void aead_random_finish(void)
Finishes using the random number source.
Definition: aead-random.c:235
void aead_random_set_seed(const unsigned char seed[32])
Restarts the random number generator with a specific 256-bit seed.
Definition: aead-random.c:385
uint64_t aead_random_generate_64(void)
Generates a single random 64-bit word.
Definition: aead-random.c:272
uint32_t aead_random_generate_32(void)
Generates a single random 32-bit word.
Definition: aead-random.c:243
void aead_random_reseed(void)
Reseeds the random number generator from the system TRNG.
Definition: aead-random.c:335
void aead_random_init(void)
Initializes the system random number generator for the generation of masking material.
Definition: aead-random.c:227
void aead_random_generate(void *buffer, unsigned size)
Generates a number of bytes into a buffer.
Definition: aead-random.c:291