-
Notifications
You must be signed in to change notification settings - Fork 0
/
aes.hpp
29 lines (22 loc) · 803 Bytes
/
aes.hpp
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
#ifndef _AES_H
#define _AES_H
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <iostream>
#include "rkey.hpp"
#include "sbox.hpp"
#include "mcol.h"
#include "srow.hpp"
using namespace std;
#define BLOCK_SIZE 16
#define KEY_128 16
#define KEY_192 24
#define KEY_256 32
int ZeroPadding(uint8_t *plaintxt, int plainSz);
int RevertZeroPadding(uint8_t *decipherTxt, int decipherTxtSize);
uint8_t* AESBlockCipher(uint8_t *src, uint8_t *cipherKey, int keyByteSize);
uint8_t* AESBlockDecipher(uint8_t *src, uint8_t *cipherKey, int keyByteSize);
int EncryptAESCBC(uint8_t *src, int plainSize, uint8_t *IV, uint8_t *cipherKey, int keyByteSize, uint8_t *dst);
int DecryptAESCBC(uint8_t *src, int cipherSize, uint8_t *IV, uint8_t *cipherKey, int keyByteSize, uint8_t *dst);
#endif // !_AES_H