Oregami
Repositories/oxedyne/fe2o3

oxedyne/fe2o3/fe2o3_crypto/src/c/rng.h

1.2 KiB, 1 run

created by r1870400018:222, which is this file's identity for as long as the history lasts, whatever it is later renamed to

download · who wrote it · its history

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