Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

seal.h

00001 #ifndef CRYPTOPP_SEAL_H 00002 #define CRYPTOPP_SEAL_H 00003 00004 #include "strciphr.h" 00005 00006 NAMESPACE_BEGIN(CryptoPP) 00007 00008 template <class B = BigEndian> 00009 struct SEAL_Info : public FixedKeyLength<20, SimpleKeyingInterface::INTERNALLY_GENERATED_IV> 00010 { 00011 static const char *StaticAlgorithmName() {return B::ToEnum() == LITTLE_ENDIAN_ORDER ? "SEAL-3.0-LE" : "SEAL-3.0-BE";} 00012 }; 00013 00014 template <class B = BigEndian> 00015 class SEAL_Policy : public AdditiveCipherConcretePolicy<word32, 1024>, public SEAL_Info<B> 00016 { 00017 public: 00018 unsigned int IVSize() const {return 4;} 00019 void GetNextIV(byte *IV) const {UnalignedPutWord(BIG_ENDIAN_ORDER, IV, m_outsideCounter+1);} 00020 00021 protected: 00022 void CipherSetKey(const NameValuePairs &params, const byte *key, unsigned int length); 00023 void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, unsigned int iterationCount); 00024 void CipherResynchronize(byte *keystreamBuffer, const byte *IV); 00025 bool IsRandomAccess() const {return true;} 00026 void SeekToIteration(dword iterationCount); 00027 00028 private: 00029 FixedSizeSecBlock<word32, 512> m_T; 00030 FixedSizeSecBlock<word32, 256> m_S; 00031 SecBlock<word32> m_R; 00032 00033 word32 m_startCount, m_iterationsPerCount; 00034 word32 m_outsideCounter, m_insideCounter; 00035 }; 00036 00037 //! <a href="http://www.weidai.com/scan-mirror/cs.html#SEAL-3.0-BE">SEAL</a> 00038 template <class B = BigEndian> 00039 struct SEAL : public SEAL_Info<B>, public SymmetricCipherDocumentation 00040 { 00041 typedef SymmetricCipherFinalTemplate<ConcretePolicyHolder<SEAL_Policy<B>, AdditiveCipherTemplate<> >, SEAL_Info<B> > Encryption; 00042 typedef Encryption Decryption; 00043 }; 00044 00045 NAMESPACE_END 00046 00047 #endif

Generated on Fri Aug 13 09:56:55 2004 for Crypto++ by doxygen 1.3.7