Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.1 KiB

  1. #ifndef CRYPTOPP_CAMELLIA_H
  2. #define CRYPTOPP_CAMELLIA_H
  3. #include "config.h"
  4. /** \file
  5. */
  6. #include "seckey.h"
  7. #include "secblock.h"
  8. NAMESPACE_BEGIN(CryptoPP)
  9. //! _
  10. struct Camellia_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8>
  11. {
  12. static const char *StaticAlgorithmName() {return "Camellia";}
  13. };
  14. /// <a href="http://www.weidai.com/scan-mirror/cs.html#Camellia">Camellia</a>
  15. class Camellia : public Camellia_Info, public BlockCipherDocumentation
  16. {
  17. class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<Camellia_Info>
  18. {
  19. public:
  20. void UncheckedSetKey(const byte *key, unsigned int keylen, const NameValuePairs &params);
  21. void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
  22. protected:
  23. static const byte s1[256];
  24. static const word32 SP[4][256];
  25. unsigned int m_rounds;
  26. SecBlock<word32> m_key;
  27. };
  28. public:
  29. typedef BlockCipherFinal<ENCRYPTION, Base> Encryption;
  30. typedef BlockCipherFinal<DECRYPTION, Base> Decryption;
  31. };
  32. typedef Camellia::Encryption CamelliaEncryption;
  33. typedef Camellia::Decryption CamelliaDecryption;
  34. NAMESPACE_END
  35. #endif