PQLR
Postquantum Crypto Library by QAPP
rng.h
Go to the documentation of this file.
1 /*
2  rng.h
3  Created by Bassham, Lawrence E (Fed) on 8/29/17.
4  Copyright © 2017 Bassham, Lawrence E (Fed). All rights reserved.
5 */
6 
7 #ifndef rng_h
8 #define rng_h
9 
10 #include <stdio.h>
11 
12 #define RNG_SUCCESS 0
13 #define RNG_BAD_MAXLEN -1
14 #define RNG_BAD_OUTBUF -2
15 #define RNG_BAD_REQ_LEN -3
16 
17 typedef struct
18 {
19  unsigned char buffer[16];
21  unsigned long length_remaining;
22  unsigned char key[32];
23  unsigned char ctr[16];
25 
26 typedef struct
27 {
28  unsigned char Key[32];
29  unsigned char V[16];
32 
33 
35  unsigned char* provided_data, unsigned char* Key, unsigned char* V);
36 
38  AES_XOF_struct* ctx,
39  unsigned char* seed,
40  unsigned char* diversifier,
41  unsigned long maxlen);
42 
43 int seedexpander(AES_XOF_struct* ctx, unsigned char* x, unsigned long xlen);
44 
46  unsigned char* entropy_input,
47  unsigned char* personalization_string,
48  int security_strength);
49 
50 int randombytes(unsigned char* x, unsigned long long xlen);
51 
52 #endif /* rng_h */
int seedexpander(AES_XOF_struct *ctx, unsigned char *x, unsigned long xlen)
int seedexpander_init(AES_XOF_struct *ctx, unsigned char *seed, unsigned char *diversifier, unsigned long maxlen)
void randombytes_init(unsigned char *entropy_input, unsigned char *personalization_string, int security_strength)
int randombytes(unsigned char *x, unsigned long long xlen)
void AES256_CTR_DRBG_Update(unsigned char *provided_data, unsigned char *Key, unsigned char *V)
Definition: rng.h:27
int reseed_counter
Definition: rng.h:30
Definition: rng.h:18
int buffer_pos
Definition: rng.h:20
unsigned long length_remaining
Definition: rng.h:21