Team Fortress 2 Source Code as on 22/4/2020
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.

40 lines
1003 B

  1. // seed.h - written and placed in the public domain by Wei Dai
  2. //! \file seed.h
  3. //! \brief Classes for the SEED block cipher
  4. #ifndef CRYPTOPP_SEED_H
  5. #define CRYPTOPP_SEED_H
  6. #include "seckey.h"
  7. #include "secblock.h"
  8. NAMESPACE_BEGIN(CryptoPP)
  9. //! _
  10. struct SEED_Info : public FixedBlockSize<16>, public FixedKeyLength<16>, public FixedRounds<16>
  11. {
  12. static const char *StaticAlgorithmName() {return "SEED";}
  13. };
  14. /// <a href="http://www.cryptolounge.org/wiki/SEED">SEED</a>
  15. class SEED : public SEED_Info, public BlockCipherDocumentation
  16. {
  17. class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<SEED_Info>
  18. {
  19. public:
  20. void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs &params);
  21. void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
  22. protected:
  23. FixedSizeSecBlock<word32, 32> m_k;
  24. };
  25. public:
  26. typedef BlockCipherFinal<ENCRYPTION, Base> Encryption;
  27. typedef BlockCipherFinal<DECRYPTION, Base> Decryption;
  28. };
  29. NAMESPACE_END
  30. #endif