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

📄 tea.h

📁 几十种常用的加密算法库 vc6 模块封装良好方便使用
💻 H
字号:
#ifndef CRYPTOPP_TEA_H
#define CRYPTOPP_TEA_H

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

NAMESPACE_BEGIN(CryptoPP)

class TEA : public BlockTransformation
{
public:
	TEA(const byte *userKey);

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

protected:
	static const word32 DELTA;
	SecBlock<word32> k;
};

class TEAEncryption : public TEA
{
public:
	TEAEncryption(const byte *userKey)
		: TEA(userKey) {}

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

class TEADecryption : public TEA
{
public:
	TEADecryption(const byte *userKey)
		: TEA(userKey) {}

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

NAMESPACE_END

#endif

⌨️ 快捷键说明

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