summaryrefslogtreecommitdiff
path: root/lib/lib3.h
blob: 8adbbb9a4ed59387496ed11d19a18b7c2b89a477 (plain)
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
#ifndef __LIB3_H__
#define __LIB3_H__

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <openssl/aes.h>

#define BLOCKSIZE 16

#define MT_19937_N 624
// needed for initialization
#define MT_19937_F 0x6C078965
// word size
#define MT_19937_W 32
#define MT_19937_UPPER_MASK 0x80000000
#define MT_19937_LOWER_MASK 0x7fffffff

struct mt_19937_state {
	unsigned int mt[MT_19937_N];
	unsigned int index;
};

struct mt_19937_state __global_mt_19937;

char *challenge17_encrypt(int *length);
int cbc_padding_oracle(char *encrypted, int length);
int aes_ctr(char *in, int length_in, char *out, char *string_key, char *nonce);

void mt_19937_seed(unsigned int seed);
int mt_19937();

#endif