File indexing completed on 2025-01-18 09:54:54
0001
0002
0003
0004
0005
0006 #ifndef CRYPTOPP_CAMELLIA_H
0007 #define CRYPTOPP_CAMELLIA_H
0008
0009 #include "config.h"
0010 #include "seckey.h"
0011 #include "secblock.h"
0012
0013 NAMESPACE_BEGIN(CryptoPP)
0014
0015
0016 struct Camellia_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8>
0017 {
0018 CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Camellia";}
0019 };
0020
0021
0022
0023 class Camellia : public Camellia_Info, public BlockCipherDocumentation
0024 {
0025 class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<Camellia_Info>
0026 {
0027 public:
0028 void UncheckedSetKey(const byte *key, unsigned int keylen, const NameValuePairs ¶ms);
0029 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
0030
0031 protected:
0032 CRYPTOPP_ALIGN_DATA(4) static const byte s1[256];
0033 static const word32 SP[4][256];
0034
0035 unsigned int m_rounds;
0036 SecBlock<word32> m_key;
0037 };
0038
0039 public:
0040 typedef BlockCipherFinal<ENCRYPTION, Base> Encryption;
0041 typedef BlockCipherFinal<DECRYPTION, Base> Decryption;
0042 };
0043
0044 typedef Camellia::Encryption CamelliaEncryption;
0045 typedef Camellia::Decryption CamelliaDecryption;
0046
0047 NAMESPACE_END
0048
0049 #endif