diff options
| author | Benedict <benedict@0xb8000.de> | 2016-08-11 17:55:46 +0200 |
|---|---|---|
| committer | Benedict <benedict@0xb8000.de> | 2017-02-21 13:00:25 +0100 |
| commit | 62fa141050aa054183fb781fed8e782f99e6072f (patch) | |
| tree | 0b3cd551675a835880f7f9d6665d2e0055818d7b /lib/lib3.h | |
| parent | 7060b54d2385018fc5f7c081dfd0630db3b402e2 (diff) | |
set3, completed challenge 21
Diffstat (limited to 'lib/lib3.h')
| -rw-r--r-- | lib/lib3.h | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -8,9 +8,26 @@ #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 |
