Crypto++  5.6.3
Free C++ class library of cryptographic schemes
gost.h
Go to the documentation of this file.
1 // gost.h - written and placed in the public domain by Wei Dai
2 
3 //! \file gost.h
4 //! \brief Classes for the GIST block cipher
5 
6 #ifndef CRYPTOPP_GOST_H
7 #define CRYPTOPP_GOST_H
8 
9 #include "seckey.h"
10 #include "secblock.h"
11 
12 NAMESPACE_BEGIN(CryptoPP)
13 
14 //! _
15 struct GOST_Info : public FixedBlockSize<8>, public FixedKeyLength<32>
16 {
17  static const char *StaticAlgorithmName() {return "GOST";}
18 };
19 
20 /// <a href="http://www.weidai.com/scan-mirror/cs.html#GOST">GOST</a>
21 class GOST : public GOST_Info, public BlockCipherDocumentation
22 {
23  class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<GOST_Info>
24  {
25  public:
26  void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &params);
27 
28  protected:
29  static void PrecalculateSTable();
30 
31  static const byte sBox[8][16];
32  static volatile bool sTableCalculated;
33  static word32 sTable[4][256];
34 
36  };
37 
38  class CRYPTOPP_NO_VTABLE Enc : public Base
39  {
40  public:
41  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
42  };
43 
44  class CRYPTOPP_NO_VTABLE Dec : public Base
45  {
46  public:
47  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
48  };
49 
50 public:
53 };
54 
57 
58 NAMESPACE_END
59 
60 #endif
Inherited by keyed algorithms with fixed key length.
Definition: seckey.h:113
Provides Encryption and Decryption typedefs used by derived classes to implement a block cipher...
Definition: seckey.h:385
Classes and functions for secure memory allocations.
Inherited by block ciphers with fixed block size.
Definition: seckey.h:34
Classes and functions for implementing secret key algorithms.
_
Definition: gost.h:15
GOST
Definition: gost.h:21
Provides class member functions to access BlockCipher constants.
Definition: seckey.h:292
Crypto++ library namespace.
Interface for retrieving values given their names.
Definition: cryptlib.h:261