idea.h

来自「各种加密算法的源代码」· C头文件 代码 · 共 41 行

H
41
字号
#ifndef IDEA_H
#define IDEA_H

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

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

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

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

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

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

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

#endif

⌨️ 快捷键说明

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