Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:55:08

0001 // seed.h - originally written and placed in the public domain by Wei Dai

0002 
0003 /// \file seed.h

0004 /// \brief Classes for the SEED block cipher

0005 /// \since Crypto++ 5.6.0

0006 
0007 #ifndef CRYPTOPP_SEED_H
0008 #define CRYPTOPP_SEED_H
0009 
0010 #include "seckey.h"
0011 #include "secblock.h"
0012 
0013 NAMESPACE_BEGIN(CryptoPP)
0014 
0015 /// \brief SEED block cipher information

0016 /// \since Crypto++ 5.6.0

0017 struct SEED_Info : public FixedBlockSize<16>, public FixedKeyLength<16>, public FixedRounds<16>
0018 {
0019     CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "SEED";}
0020 };
0021 
0022 /// \brief SEED block cipher

0023 /// \sa <a href="http://www.cryptolounge.org/wiki/SEED">SEED</a>

0024 /// \since Crypto++ 5.6.0

0025 class SEED : public SEED_Info, public BlockCipherDocumentation
0026 {
0027     class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<SEED_Info>
0028     {
0029     public:
0030         void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs &params);
0031         void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
0032 
0033     protected:
0034         FixedSizeSecBlock<word32, 32> m_k;
0035     };
0036 
0037 public:
0038     typedef BlockCipherFinal<ENCRYPTION, Base> Encryption;
0039     typedef BlockCipherFinal<DECRYPTION, Base> Decryption;
0040 };
0041 
0042 NAMESPACE_END
0043 
0044 #endif