2019-05-24 17:38:54 +01:00
|
|
|
#ifndef RNG_H
|
|
|
|
#define RNG_H
|
2019-05-19 18:14:46 +01:00
|
|
|
|
2019-05-24 17:38:54 +01:00
|
|
|
#include <stddef.h>
|
2019-05-27 19:17:53 +01:00
|
|
|
#include <stdint.h>
|
2019-05-19 18:14:46 +01:00
|
|
|
|
2019-05-27 19:17:53 +01:00
|
|
|
#define RNG_SUCCESS ( 0)
|
|
|
|
#define RNG_BAD_MAXLEN (-1)
|
|
|
|
#define RNG_BAD_OUTBUF (-2)
|
|
|
|
#define RNG_BAD_REQ_LEN (-3)
|
2019-05-19 18:14:46 +01:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
unsigned char buffer[16];
|
2019-05-24 17:38:54 +01:00
|
|
|
unsigned int buffer_pos;
|
|
|
|
uint64_t length_remaining;
|
2019-05-19 18:14:46 +01:00
|
|
|
unsigned char key[32];
|
|
|
|
unsigned char ctr[16];
|
|
|
|
} AES_XOF_struct;
|
|
|
|
|
|
|
|
|
2019-05-24 17:38:54 +01:00
|
|
|
int PQCLEAN_LEDAKEMLT12_CLEAN_seedexpander(AES_XOF_struct *ctx, unsigned char *x, size_t xlen);
|
2019-05-19 18:14:46 +01:00
|
|
|
|
2019-05-24 17:38:54 +01:00
|
|
|
/* TRNG_BYTE_LENGTH wide buffer */
|
|
|
|
void PQCLEAN_LEDAKEMLT12_CLEAN_seedexpander_from_trng(AES_XOF_struct *ctx, const unsigned char *trng_entropy);
|
2019-05-19 18:14:46 +01:00
|
|
|
|
2019-05-24 17:38:54 +01:00
|
|
|
#endif
|