-
Notifications
You must be signed in to change notification settings - Fork 10
/
fips140.h
47 lines (37 loc) · 816 Bytes
/
fips140.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
class fips140
{
/* ringbuffer of 20000 bits */
unsigned char fips140_rval[20000/8];
/* point to current, ehr, thing */
int fips140_p;
/* number of bits in ringbuffer */
int fips140_nbits;
/* number of new bits after a long-test */
int fips140_nnewbits;
/* number of bits set to 1 (monobit test) */
int fips140_n1;
/* for poker test */
int fips140_pokerbuf[16];
/* where to store statistics */
struct
{
int monobit;
int poker;
int longrun;
int runs;
} stats_t;
int fips_version;
char *user;
static unsigned char fips140_bit1cnt[256];
bool fips140_shorttest();
bool fips140_longtest();
public:
fips140();
~fips140();
static void init();
void set_fips_version(int version);
void set_user(const char *puser);
void add(unsigned char newval);
bool is_ok();
char *stats();
};