⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 idea.h

📁 300种加密解密的算法源代码
💻 H
字号:
#ifndef CRYPTOPP_IDEA_H
#define CRYPTOPP_IDEA_H

#include "cryptlib.h"
#include "misc.h"

NAMESPACE_BEGIN(CryptoPP)

class IDEA : public BlockTransformation
{
public:
	IDEA(const byte *userKey, CipherDir dir);

	void ProcessBlock(byte * inoutBlock) const
		{IDEA::ProcessBlock(inoutBlock, inoutBlock);}
	void ProcessBlock(const byte *inBlock, byte * outBlock) const;

	enum {KEYLENGTH=16, BLOCKSIZE=8, ROUNDS=8};
	unsigned int BlockSize() const {return BLOCKSIZE;};

private:
	void EnKey(const byte *);
	void DeKey();
	SecBlock<word> key;

#ifdef IDEA_LARGECACHE
	static inline void LookupMUL(unsigned int &a, word16 b);
	void LookupKeyLogs();
	static void BuildLogTables();
	static bool tablesBuilt;
	static word16 log[0x10000], antilog[0x10000];
#endif
};

class IDEAEncryption : public IDEA
{
public:
	IDEAEncryption(const byte * userKey)
		: IDEA (userKey, ENCRYPTION) {}
};

class IDEADecryption : public IDEA
{
public:
	IDEADecryption(const byte * userKey)
		: IDEA (userKey, DECRYPTION) {}
};

NAMESPACE_END

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -