Crypto++  5.6.5
Free C++ class library of cryptographic schemes
skipjack.h
Go to the documentation of this file.
1 // skipjack.h - originally 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 /// \brief SKIPJACK block cipher information
15 struct SKIPJACK_Info : public FixedBlockSize<8>, public FixedKeyLength<10>
16 {
17  CRYPTOPP_DLL static const char * CRYPTOPP_API StaticAlgorithmName() {return "SKIPJACK";}
18 };
19 
20 /// \brief SKIPJACK block cipher
21 /// \sa <a href="http://www.cryptopp.com/wiki/SKIPJACK">SKIPJACK</a>
23 {
24  /// \brief SKIPJACK block cipher default operation
25  class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<SKIPJACK_Info>
26  {
27  public:
28  void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &params);
29  unsigned int OptimalDataAlignment() const {return GetAlignmentOf<word16>();}
30 
31  protected:
32  static const byte fTable[256];
33 
35  };
36 
37  /// \brief SKIPJACK block cipher encryption operation
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  /// \brief SKIPJACK block cipher decryption operation
48  class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Dec : public Base
49  {
50  public:
51  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
52  private:
53  static const byte Sd[256];
54  static const word32 Td[4][256];
55  };
56 
57 public:
60 };
61 
64 
65 NAMESPACE_END
66 
67 #endif
Inherited by keyed algorithms with fixed key length.
Definition: seckey.h:146
Provides Encryption and Decryption typedefs used by derived classes to implement a block cipher...
Definition: seckey.h:419
SKIPJACK block cipher information.
Definition: skipjack.h:15
Interface for one direction (encryption or decryption) of a block cipher.
Definition: cryptlib.h:1228
Classes and functions for secure memory allocations.
Inherited by algorithms with fixed block size.
Definition: seckey.h:39
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:22
Crypto++ library namespace.
Interface for retrieving values given their names.
Definition: cryptlib.h:291