代码拉取完成,页面将自动刷新
同步操作将从 老张/TdxTradeServer 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/*
* FileName : AES.h
*
*/
#ifndef __AES_H__
#define __AES_H__
#include <cstdio>
void print(unsigned char* state, int len);
class AES
{
public:
AES(unsigned char* key = NULL);
virtual ~AES();
void SetKey(unsigned char *key);
unsigned char* Cipher(unsigned char* input, unsigned char* output);
unsigned char* InvCipher(unsigned char* input, unsigned char* output);
void* Cipher(void* input, void *output, int length=0);
void* InvCipher(void* input,void *output, int length);
private:
unsigned char Sbox[256];
unsigned char InvSbox[256];
unsigned char w[11][4][4];
void KeyExpansion(unsigned char* key, unsigned char w[][4][4]);
unsigned char FFmul(unsigned char a, unsigned char b);
void SubBytes(unsigned char state[][4]);
void ShiftRows(unsigned char state[][4]);
void MixColumns(unsigned char state[][4]);
void AddRoundKey(unsigned char state[][4], unsigned char k[][4]);
void InvSubBytes(unsigned char state[][4]);
void InvShiftRows(unsigned char state[][4]);
void InvMixColumns(unsigned char state[][4]);
};
enum AESMode_t { MODE_OFB = 1, MODE_CFB, MODE_CBC, MODE_ECB };
class AESModeOfOperation {
private:
AES *m_aes;
AESMode_t m_mode;
unsigned char m_key[16];
unsigned char m_iv[16];
// bool m_firstround;
public:
AESModeOfOperation();
~AESModeOfOperation();
void set_mode(AESMode_t _mode);
//AESMode_t get_mode();
void set_key (unsigned char *key);
void set_iv(unsigned char *iv);
int Encrypt(unsigned char *input, int length, unsigned char *output);
int Decrypt(unsigned char *input, int length, unsigned char *output);
};
#endif
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。