00001 #ifndef CRYPTOPP_SOSEMANUK_H
00002 #define CRYPTOPP_SOSEMANUK_H
00003
00004 #include "strciphr.h"
00005
00006 NAMESPACE_BEGIN(CryptoPP)
00007
00008
00009 struct SosemanukInfo : public VariableKeyLength<16, 1, 32, 1, SimpleKeyingInterface::UNIQUE_IV, 16>
00010 {
00011 static const char * StaticAlgorithmName() {return "Sosemanuk";}
00012 };
00013
00014
00015 class SosemanukPolicy : public AdditiveCipherConcretePolicy<word32, 20>, public SosemanukInfo
00016 {
00017 protected:
00018 void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length);
00019 void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount);
00020 void CipherResynchronize(byte *keystreamBuffer, const byte *iv);
00021 bool IsRandomAccess() const {return false;}
00022 #if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X64
00023 unsigned int GetAlignment() const;
00024 unsigned int GetOptimalBlockSize() const;
00025 #endif
00026
00027 FixedSizeSecBlock<word32, 25*4> m_key;
00028 FixedSizeAlignedSecBlock<word32, 12> m_state;
00029 };
00030
00031
00032 struct Sosemanuk : public SosemanukInfo, public SymmetricCipherDocumentation
00033 {
00034 typedef SymmetricCipherFinal<ConcretePolicyHolder<SosemanukPolicy, AdditiveCipherTemplate<> >, SosemanukInfo> Encryption;
00035 typedef Encryption Decryption;
00036 };
00037
00038 NAMESPACE_END
00039
00040 #endif