- Main Page
- Namespaces
- Classes
- Files

- File List
- 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 //! _
    00013 struct SKIPJACK_Info : public FixedBlockSize<8>, public FixedKeyLength<10>
    00014 {
    00015         CRYPTOPP_DLL static const char * CRYPTOPP_API StaticAlgorithmName() {return "SKIPJACK";}
    00016 };
    00017
    00018 /// <a href="http://www.weidai.com/scan-mirror/cs.html#SKIPJACK">SKIPJACK</a>
    00019 class SKIPJACK : public SKIPJACK_Info, public BlockCipherDocumentation
    00020 {
    00021         class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<SKIPJACK_Info>
    00022         {
    00023         public:
    00024                 void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length);
    00025
    00026         protected:
    00027                 static const byte fTable[256];
    00028
    00029                 FixedSizeSecBlock<byte[256], 10> tab;
    00030         };
    00031
    00032         class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Enc : public Base
    00033         {
    00034         public:
    00035                 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
    00036         private:
    00037                 static const byte Se[256];
    00038                 static const word32 Te[4][256];
    00039         };
    00040
    00041         class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Dec : public Base
    00042         {
    00043         public:
    00044                 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
    00045         private:
    00046                 static const byte Sd[256];
    00047                 static const word32 Td[4][256];
    00048         };
    00049
    00050 public:
    00051         typedef BlockCipherFinal<ENCRYPTION, Enc> Encryption;
    00052         typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
    00053 };
    00054
    00055 typedef SKIPJACK::Encryption SKIPJACKEncryption;
    00056 typedef SKIPJACK::Decryption SKIPJACKDecryption;
    00057
    00058 NAMESPACE_END
    00059
    00060 #endif