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

📄 wake.h

📁 各种加密算法的源代码
💻 H
字号:
#ifndef WAKE_H
#define WAKE_H

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

class WAKE
{
protected:
    inline word32 M(word32 x, word32 y);
    inline void enc(word32 &V);
    inline void dec(word32 &V);
    void genkey(word32 k0, word32 k1, word32 k2, word32 k3);

    word32 t[257];
    word32 r3, r4, r5, r6;
};

class WAKEEncryption : public Filter, protected WAKE
{
public:
    WAKEEncryption(const byte *key, BufferedTransformation *outQueue = new ByteQueue);

    void Put(byte inByte)
    {
        if (inbufSize==INBUFMAX)
            ProcessInbuf();
        inbuf[inbufSize++] = inByte;
    }

    void Put(const byte *inString, unsigned int length);
    void InputFinished();

protected:
    virtual void ProcessInbuf();
    enum {INBUFMAX=256};
    SecByteBlock inbuf;
    unsigned int inbufSize;
};

class WAKEDecryption : public WAKEEncryption
{
public:
    WAKEDecryption(const byte *key, BufferedTransformation *outQueue = new ByteQueue)
        : WAKEEncryption(key, outQueue) {lastBlock=FALSE;}

    void InputFinished();

protected:
    virtual void ProcessInbuf();
    boolean lastBlock;
};

#endif

⌨️ 快捷键说明

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