📄 aes.h
字号:
#if !defined(AFX_AES_H__37833D4E_6F69_4F09_8D85_456490CC056C__INCLUDED_)
#define AFX_AES_H__37833D4E_6F69_4F09_8D85_456490CC056C__INCLUDED_
#define BYTE unsigned char
#define WORD unsigned long
#define ROTL(x) (((x)>>7)|((x)<<1))
#define ROTL8(x) (((x)<<8)|((x)>>24))
#define ROTL16(x) (((x)<<16)|((x)>>16))
#define ROTL24(x) (((x)<<24)|((x)>>8))
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// AES.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// AES window
class AES : public CAnimateCtrl
{
// Construction
public:
AES();
// Attributes
public:
BYTE InCo[4];
BYTE fbsub[256];
BYTE rbsub[256];
BYTE ptab[256],ltab[256];
WORD ftable[256];
WORD rtable[256];
WORD rco[30];
WORD pack(BYTE *b);
void unpack(WORD a,BYTE *b);
BYTE xtime(BYTE a);
BYTE bmul(BYTE x,BYTE y);
WORD SubByte(WORD a);
BYTE product(WORD x,WORD y);
WORD InvMixCol(WORD x);
char *encode();
char *decode();
char key[32];
char block[32];
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(AES)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~AES();
// Generated message map functions
protected:
//{{AFX_MSG(AES)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
int Nk;
int Nb;
int Nr;
BYTE fi[24];
BYTE ri[24];
WORD fkey[120];
WORD rkey[120];
BYTE ByteSub(BYTE x);
void gentables();
void strtoHex(char *str,char *hex);
void hextoStr(char *hex,char *str);
void gkey(int nb,int nk,char *key);
void encrypt(char *buff);
void decrypt(char *buff);
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_AES_H__37833D4E_6F69_4F09_8D85_456490CC056C__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -