Mention what is optional and what is required for a randombytes implementation

This commit is contained in:
Frank Denis 2015-01-18 10:12:27 +01:00
parent 0b4fb379d4
commit 5b3d8a4bf9

View File

@ -17,12 +17,12 @@ extern "C" {
#endif
typedef struct randombytes_implementation {
const char *(*implementation_name)(void);
uint32_t (*random)(void);
void (*stir)(void);
uint32_t (*uniform)(const uint32_t upper_bound);
void (*buf)(void * const buf, const size_t size);
int (*close)(void);
const char *(*implementation_name)(void); /* required */
uint32_t (*random)(void); /* required */
void (*stir)(void); /* optional */
uint32_t (*uniform)(const uint32_t upper_bound); /* optional, a default implementation will be used if NULL */
void (*buf)(void * const buf, const size_t size); /* required */
int (*close)(void); /* optional */
} randombytes_implementation;
SODIUM_EXPORT