1
#ifndef CRYPTOPP_SERPENT_H
2
#define CRYPTOPP_SERPENT_H
10
NAMESPACE_BEGIN(CryptoPP)
13
struct Serpent_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 0, 32>, public FixedRounds<32>
15
static const char *StaticAlgorithmName() {return "Serpent";}
18
/// <a href="http://www.weidai.com/scan-mirror/cs.html#Serpent">Serpent</a>
19
class Serpent : public Serpent_Info, public BlockCipherDocumentation
21
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<Serpent_Info>
24
void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms);
27
FixedSizeSecBlock<word32, 33*4> m_key;
30
class CRYPTOPP_NO_VTABLE Enc : public Base
33
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
36
class CRYPTOPP_NO_VTABLE Dec : public Base
39
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
43
typedef BlockCipherFinal<ENCRYPTION, Enc> Encryption;
44
typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
47
typedef Serpent::Encryption SerpentEncryption;
48
typedef Serpent::Decryption SerpentDecryption;