📄 md5dlg.h
字号:
// MD5Dlg.h : header file
//
#if !defined(AFX_MD5DLG_H__5332C122_82EB_4FB5_BE08_31F38E4C2B38__INCLUDED_)
#define AFX_MD5DLG_H__5332C122_82EB_4FB5_BE08_31F38E4C2B38__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
typedef unsigned char BYTE;
typedef unsigned long int UINT4;
/* F, G, H 和 I 是基本MD5函数 */
#define F(x, y, z) (((x)&(y))|((~x)&(z)))
#define G(x, y, z) (((x)&(z))|((y)&(~z)))
#define H(x, y, z) ((x)^(y)^(z))
#define I(x, y, z) ((y)^((x)|(~z)))
/* ROTATE_LEFT 将x循环左移n位 */
#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
/* 循环从加法中分离出是为了防止重复计算*/
#define FF(a, b, c, d, x, s, ac) { (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); (a) = ROTATE_LEFT ((a), (s)); (a) += (b); }
#define GG(a, b, c, d, x, s, ac) { (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); (a) = ROTATE_LEFT ((a), (s)); (a) += (b); }
#define HH(a, b, c, d, x, s, ac) { (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); (a) = ROTATE_LEFT ((a), (s)); (a) += (b); }
#define II(a, b, c, d, x, s, ac) { (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); (a) = ROTATE_LEFT ((a), (s)); (a) += (b); }
#define S11 7
#define S12 12
#define S13 17
#define S14 22
#define S21 5
#define S22 9
#define S23 14
#define S24 20
#define S31 4
#define S32 11
#define S33 16
#define S34 23
#define S41 6
#define S42 10
#define S43 15
#define S44 21
//////////SHA变换函数定义
#define F1(B,C,D) (B&C)|((~B)&D)//当i属于【0,19】之间时使用此函数
#define F2(B,C,D) B^C^D//当i属于【20,39】之间时使用此函数
#define F3(B,C,D) (B&C)|(B&D)|(C&D)//当i属于【40,59】之间时使用此函数
#define F4(B,C,D) B^C^D//当i属于【60,79】之间时使用此函数
#define S(x,y) ((x)<<(y))//将x左移y位
/////////////////////////////////////////////////////////////////////////////
// CMD5Dlg dialog
class CMD5Dlg : public CDialog
{
// Construction
public:
UINT4 state[4];
UINT4 H[5];
void SHA_init();
UINT4 K(int t);
UINT4 count_file_sha();
UINT4 sha_c_to_l(int l,int t);
void SHA_minwen();
UINT4 count_file();
void MINGWENERJINZHI();
UINT4 char_to_long(int l,int t);
void Init();
CMD5Dlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CMD5Dlg)
enum { IDD = IDD_MD5_DIALOG };
CEdit m_msg4;
CButton m_shajm;
CButton m_explain;
CButton m_jiami;
CString m_msg1;
CString m_msg2;
CString m_msg3;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMD5Dlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CMD5Dlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnDestroy();
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
virtual void OnOK();
afx_msg void OnSHA();
afx_msg void OnDelare();
afx_msg void OnHELP();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MD5DLG_H__5332C122_82EB_4FB5_BE08_31F38E4C2B38__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -