Crypto++  5.6.4
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
23 //! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#SKIPJACK">SKIPJACK</a>
25 {
26  //! \class Base
27  //! \brief SKIPJACK block cipher default operation
28  class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<SKIPJACK_Info>
29  {
30  public:
31  void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &params);
32  unsigned int OptimalDataAlignment() const {return GetAlignmentOf<word16>();}
33 
34  protected:
35  static const byte fTable[256];
36 
38  };
39 
40  //! \class Enc
41  //! \brief SKIPJACK block cipher encryption operation
42  class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Enc : public Base
43  {
44  public:
45  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
46  private:
47  static const byte Se[256];
48  static const word32 Te[4][256];
49  };
50 
51  //! \class Dec
52  //! \brief SKIPJACK block cipher decryption operation
53  class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Dec : public Base
54  {
55  public:
56  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
57  private:
58  static const byte Sd[256];
59  static const word32 Td[4][256];
60  };
61 
62 public:
65 };
66 
69 
70 NAMESPACE_END
71 
72 #endif
Inherited by keyed algorithms with fixed key length.
Definition: seckey.h:128
Provides Encryption and Decryption typedefs used by derived classes to implement a block cipher...
Definition: seckey.h:423
SKIPJACK block cipher information.
Definition: skipjack.h:16
Interface for one direction (encryption or decryption) of a block cipher.
Definition: cryptlib.h:1098
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:326
SKIPJACK block cipher.
Definition: skipjack.h:24
Crypto++ library namespace.
Interface for retrieving values given their names.
Definition: cryptlib.h:282