1
#ifndef CRYPTOPP_GOST_H
2
#define CRYPTOPP_GOST_H
10
NAMESPACE_BEGIN(CryptoPP)
13
struct GOST_Info : public FixedBlockSize<8>, public FixedKeyLength<32>
15
static const char *StaticAlgorithmName() {return "GOST";}
18
/// <a href="http://www.weidai.com/scan-mirror/cs.html#GOST">GOST</a>
19
class GOST : public GOST_Info, public BlockCipherDocumentation
21
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<GOST_Info>
24
void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms);
27
static void PrecalculateSTable();
29
static const byte sBox[8][16];
30
static volatile bool sTableCalculated;
31
static word32 sTable[4][256];
33
FixedSizeSecBlock<word32, 8> key;
36
class CRYPTOPP_NO_VTABLE Enc : public Base
39
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
42
class CRYPTOPP_NO_VTABLE Dec : public Base
45
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
49
typedef BlockCipherFinal<ENCRYPTION, Enc> Encryption;
50
typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
53
typedef GOST::Encryption GOSTEncryption;
54
typedef GOST::Decryption GOSTDecryption;