Crypto++  5.6.3
Free C++ class library of cryptographic schemes
skipjack.h
Go to the documentation of this file.
1 // skipjack.h - written and placed in the public domain by Wei Dai
2 
3 //! \file skipjack.h
4 //! \brief Classes for the SKIPJACK block cipher
5 
6 #ifndef CRYPTOPP_SKIPJACK_H
7 #define CRYPTOPP_SKIPJACK_H
8 
9 #include "seckey.h"
10 #include "secblock.h"
11 
12 NAMESPACE_BEGIN(CryptoPP)
13 
14 //! \class SKIPJACK_Info
15 //! \brief SKIPJACK block cipher information
16 struct SKIPJACK_Info : public FixedBlockSize<8>, public FixedKeyLength<10>
17 {
18  CRYPTOPP_DLL static const char * CRYPTOPP_API StaticAlgorithmName() {return "SKIPJACK";}
19 };
20 
21 //! \class SKIPJACK
22 //! \brief SKIPJACK block cipher information
23 //! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#SKIPJACK">SKIPJACK</a>
25 {
26  class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<SKIPJACK_Info>
27  {
28  public:
29  void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &params);
30  unsigned int OptimalDataAlignment() const {return GetAlignmentOf<word16>();}
31 
32  protected:
33  static const byte fTable[256];
34 
36  };
37 
38  class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Enc : public Base
39  {
40  public:
41  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
42  private:
43  static const byte Se[256];
44  static const word32 Te[4][256];
45  };
46 
47  class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Dec : public Base
48  {
49  public:
50  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
51  private:
52  static const byte Sd[256];
53  static const word32 Td[4][256];
54  };
55 
56 public:
59 };
60 
63 
64 NAMESPACE_END
65 
66 #endif
Inherited by keyed algorithms with fixed key length.
Definition: seckey.h:117
Provides Encryption and Decryption typedefs used by derived classes to implement a block cipher...
Definition: seckey.h:396
SKIPJACK block cipher information.
Definition: skipjack.h:16
Interface for one direction (encryption or decryption) of a block cipher.
Definition: cryptlib.h:1091
Classes and functions for secure memory allocations.
Inherited by algorithms with fixed block size.
Definition: seckey.h:34
Classes and functions for implementing secret key algorithms.
Provides a base implementation of Algorithm and SimpleKeyingInterface for block ciphers.
Definition: seckey.h:303
SKIPJACK block cipher information.
Definition: skipjack.h:24
Crypto++ library namespace.
Interface for retrieving values given their names.
Definition: cryptlib.h:277