camellia.h

Go to the documentation of this file.
00001 #ifndef CRYPTOPP_CAMELLIA_H
00002 #define CRYPTOPP_CAMELLIA_H
00003 
00004 #include "config.h"
00005 
00006 /** \file
00007 */
00008 
00009 #include "seckey.h"
00010 #include "secblock.h"
00011 
00012 NAMESPACE_BEGIN(CryptoPP)
00013 
00014 //! _
00015 struct Camellia_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8>
00016 {
00017         static const char *StaticAlgorithmName() {return "Camellia";}
00018 };
00019 
00020 /// <a href="http://www.weidai.com/scan-mirror/cs.html#Camellia">Camellia</a>
00021 class Camellia : public Camellia_Info, public BlockCipherDocumentation
00022 {
00023         class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<Camellia_Info>
00024         {
00025         public:
00026                 void UncheckedSetKey(const byte *key, unsigned int keylen, const NameValuePairs &params);
00027                 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
00028                 unsigned int BlockAlignment() const {return 8;}
00029 
00030         protected:
00031                 static const byte s1[256];
00032                 static const word32 SP[4][256];
00033 
00034                 unsigned int m_rounds;
00035                 SecBlock<word32> m_key;
00036         };
00037 
00038 public:
00039         typedef BlockCipherFinal<ENCRYPTION, Base> Encryption;
00040         typedef BlockCipherFinal<DECRYPTION, Base> Decryption;
00041 };
00042 
00043 typedef Camellia::Encryption CamelliaEncryption;
00044 typedef Camellia::Decryption CamelliaDecryption;
00045 
00046 NAMESPACE_END
00047 
00048 #endif

Generated on Fri Jun 1 11:11:19 2007 for Crypto++ by  doxygen 1.5.2