libsodium: Needed for Dnscrypto-proxy Release 1.3.0
[tomato.git] / release / src / router / libsodium / src / libsodium / include / sodium / randombytes.h
blob5a2176b900859c4cb459d9b72c6617c831c3b4c3
2 #ifndef randombytes_H
3 #define randombytes_H
5 #include <sys/types.h>
7 #include <stddef.h>
8 #include <stdint.h>
10 #include "export.h"
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
16 typedef struct randombytes_implementation {
17 const char *(*implementation_name)(void);
18 uint32_t (*random)(void);
19 void (*stir)(void);
20 uint32_t (*uniform)(const uint32_t upper_bound);
21 void (*buf)(void * const buf, const size_t size);
22 int (*close)(void);
23 } randombytes_implementation;
25 SODIUM_EXPORT
26 int randombytes_set_implementation(randombytes_implementation *impl);
28 SODIUM_EXPORT
29 void randombytes(unsigned char *buf, unsigned long long size);
31 SODIUM_EXPORT
32 const char *randombytes_implementation_name(void);
34 SODIUM_EXPORT
35 uint32_t randombytes_random(void);
37 SODIUM_EXPORT
38 void randombytes_stir(void);
40 SODIUM_EXPORT
41 uint32_t randombytes_uniform(const uint32_t upper_bound);
43 SODIUM_EXPORT
44 void randombytes_buf(void * const buf, const size_t size);
46 SODIUM_EXPORT
47 int randombytes_close(void);
49 #ifdef __cplusplus
51 #endif
53 #endif