File indexing completed on 2025-01-18 09:55:08
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef CRYPTOPP_SERPENT_H
0009 #define CRYPTOPP_SERPENT_H
0010
0011 #include "seckey.h"
0012 #include "secblock.h"
0013
0014 NAMESPACE_BEGIN(CryptoPP)
0015
0016
0017
0018 struct Serpent_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8>, public FixedRounds<32>
0019 {
0020 CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Serpent";}
0021 };
0022
0023
0024
0025
0026
0027
0028 class Serpent : public Serpent_Info, public BlockCipherDocumentation
0029 {
0030
0031
0032
0033 class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<Serpent_Info>
0034 {
0035 public:
0036 void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms);
0037
0038 protected:
0039 FixedSizeSecBlock<word32, 33*4> m_key;
0040 };
0041
0042
0043
0044
0045
0046 class CRYPTOPP_NO_VTABLE Enc : public Base
0047 {
0048 public:
0049 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
0050 };
0051
0052
0053
0054
0055
0056 class CRYPTOPP_NO_VTABLE Dec : public Base
0057 {
0058 public:
0059 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
0060 };
0061
0062 public:
0063 typedef BlockCipherFinal<ENCRYPTION, Enc> Encryption;
0064 typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
0065 };
0066
0067 typedef Serpent::Encryption SerpentEncryption;
0068 typedef Serpent::Decryption SerpentDecryption;
0069
0070 NAMESPACE_END
0071
0072 #endif