Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# skipjack.h

Go to the documentation of this file.

    00001 #ifndef CRYPTOPP_SKIPJACK_H
    00002 #define CRYPTOPP_SKIPJACK_H
    00003
    00004 /** \file
    00005 */
    00006
    00007 #include "seckey.h"
    00008 #include "secblock.h"
    00009
    00010 NAMESPACE_BEGIN(CryptoPP)
    00011
    00012 struct SKIPJACK_Info : public FixedBlockSize<8>, public FixedKeyLength<10>
    00013 {
    00014         CRYPTOPP_DLL static const char * StaticAlgorithmName() {return "SKIPJACK";}
    00015 };
    00016
    00017 /// <a href="http://www.weidai.com/scan-mirror/cs.html#SKIPJACK">SKIPJACK</a>
    00018 class SKIPJACK : public SKIPJACK_Info, public BlockCipherDocumentation
    00019 {
    00020         class CRYPTOPP_DLL Base : public BlockCipherBaseTemplate<SKIPJACK_Info>
    00021         {
    00022         public:
    00023                 void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length);
    00024
    00025         protected:
    00026                 static const byte fTable[256];
    00027
    00028                 FixedSizeSecBlock<byte[256], 10> tab;
    00029         };
    00030
    00031         class CRYPTOPP_DLL Enc : public Base
    00032         {
    00033         public:
    00034                 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
    00035         private:
    00036                 static const byte Se[256];
    00037                 static const word32 Te[4][256];
    00038         };
    00039
    00040         class CRYPTOPP_DLL Dec : public Base
    00041         {
    00042         public:
    00043                 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
    00044         private:
    00045                 static const byte Sd[256];
    00046                 static const word32 Td[4][256];
    00047         };
    00048
    00049 public:
    00050         typedef BlockCipherTemplate<ENCRYPTION, Enc> Encryption;
    00051         typedef BlockCipherTemplate<DECRYPTION, Dec> Decryption;
    00052 };
    00053
    00054 typedef SKIPJACK::Encryption SKIPJACKEncryption;
    00055 typedef SKIPJACK::Decryption SKIPJACKDecryption;
    00056
    00057 NAMESPACE_END
    00058
    00059 #endif