Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

serpent.h

Go to the documentation of this file.
00001 #ifndef CRYPTOPP_SERPENT_H 00002 #define CRYPTOPP_SERPENT_H 00003 00004 /** \file 00005 */ 00006 00007 #include "seckey.h" 00008 #include "secblock.h" 00009 00010 NAMESPACE_BEGIN(CryptoPP) 00011 00012 struct Serpent_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 1, 32>, public FixedRounds<32> 00013 { 00014 static const char *StaticAlgorithmName() {return "Serpent";} 00015 }; 00016 00017 /// <a href="http://www.weidai.com/scan-mirror/cs.html#Serpent">Serpent</a> 00018 class Serpent : public Serpent_Info, public BlockCipherDocumentation 00019 { 00020 class Base : public BlockCipherBaseTemplate<Serpent_Info> 00021 { 00022 public: 00023 void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length); 00024 00025 protected: 00026 FixedSizeSecBlock<word32, 140> m_key; 00027 }; 00028 00029 class Enc : public Base 00030 { 00031 public: 00032 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 00033 }; 00034 00035 class Dec : public Base 00036 { 00037 public: 00038 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; 00039 }; 00040 00041 public: 00042 typedef BlockCipherTemplate<ENCRYPTION, Enc> Encryption; 00043 typedef BlockCipherTemplate<DECRYPTION, Dec> Decryption; 00044 }; 00045 00046 typedef Serpent::Encryption SerpentEncryption; 00047 typedef Serpent::Decryption SerpentDecryption; 00048 00049 NAMESPACE_END 00050 00051 #endif

Generated on Fri Aug 13 09:56:55 2004 for Crypto++ by doxygen 1.3.7