-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMMB.h
30 lines (26 loc) · 880 Bytes
/
MMB.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
//
// Created by sauron on 11/24/20.
//
#ifndef MMB_CRYPTANALYSIS_BMM_H
#define MMB_CRYPTANALYSIS_BMM_H
#include <iostream>
#include <cstdint>
#include <cmath>
class MMB {
public:
const static uint8_t BLOCK_SIZE = 4, ROUNDS = 6;
const uint32_t delta = 0x2AAAAAAA;
const uint32_t B = 0xDAE;
const uint32_t G[BLOCK_SIZE] = {0x25F1CDB, 0x4BE39B6, 0x12F8E6D8, 0x2F8E6D81};
const uint32_t G_inv[BLOCK_SIZE] = {0xDAD4694, 0x06D6A34A, 0x81B5A8D2, 0x281B5A8D};
void Enc(uint32_t[], uint32_t[], uint32_t[]);
void Dec(uint32_t[], uint32_t[], uint32_t[]);
void sigma(uint32_t[], uint32_t[], uint32_t);
void gamma(uint32_t[]);
void gamma_inv(uint32_t[]);
void eta(uint32_t[]);
void teta(uint32_t[]);
void rho(uint32_t[], uint32_t[], uint32_t);
uint32_t* rho_inv(uint32_t[], uint32_t[], uint32_t);
};
#endif //MMB_CRYPTANALYSIS_BMM_H