1 Star 0 Fork 0

linuxmail/unrar-nonfree

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
rijndael.hpp 1.28 KB
一键复制 编辑 原始数据 按行查看 历史
YOKOTA Hiroshi 提交于 2021-11-16 18:28 +08:00 . New upstream version 6.1.2
#ifndef _RIJNDAEL_H_
#define _RIJNDAEL_H_
/**************************************************************************
* This code is based on Szymon Stefanek public domain AES implementation *
**************************************************************************/
#define _MAX_KEY_COLUMNS (256/32)
#define _MAX_ROUNDS 14
#define MAX_IV_SIZE 16
class Rijndael
{
private:
#ifdef USE_SSE
void blockEncryptSSE(const byte *input,size_t numBlocks,byte *outBuffer);
void blockDecryptSSE(const byte *input, size_t numBlocks, byte *outBuffer);
bool AES_NI;
#endif
void keySched(byte key[_MAX_KEY_COLUMNS][4]);
void keyEncToDec();
void GenerateTables();
// RAR always uses CBC, but we may need to turn it off when calling
// this code from other archive formats with CTR and other modes.
bool CBCMode;
int m_uRounds;
byte m_initVector[MAX_IV_SIZE];
byte m_expandedKey[_MAX_ROUNDS+1][4][4];
public:
Rijndael();
void Init(bool Encrypt,const byte *key,uint keyLen,const byte *initVector);
void blockEncrypt(const byte *input, size_t inputLen, byte *outBuffer);
void blockDecrypt(const byte *input, size_t inputLen, byte *outBuffer);
void SetCBCMode(bool Mode) {CBCMode=Mode;}
};
#endif // _RIJNDAEL_H_
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/linuxmail/unrar-nonfree.git
git@gitee.com:linuxmail/unrar-nonfree.git
linuxmail
unrar-nonfree
unrar-nonfree
master

搜索帮助