From bbbd09553b373b5f32f339186ea689132fde21ae Mon Sep 17 00:00:00 2001 From: weidai Date: Sun, 15 Apr 2007 22:54:31 +0000 Subject: SSE2 optimizations --- salsa.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'salsa.h') diff --git a/salsa.h b/salsa.h index 8d6bedf2..176a1a3c 100755 --- a/salsa.h +++ b/salsa.h @@ -8,7 +8,7 @@ NAMESPACE_BEGIN(CryptoPP) //! _ -struct Salsa20_Info : public VariableKeyLength<32, 16, 32, 16, SimpleKeyingInterface::STRUCTURED_IV, 8> +struct Salsa20_Info : public VariableKeyLength<32, 16, 32, 16, SimpleKeyingInterface::UNIQUE_IV, 8> { static const char *StaticAlgorithmName() {return "Salsa20";} }; @@ -22,13 +22,17 @@ protected: void CipherResynchronize(byte *keystreamBuffer, const byte *IV); bool IsRandomAccess() const {return true;} void SeekToIteration(lword iterationCount); +#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X64 + unsigned int GetAlignment() const; + unsigned int GetOptimalBlockSize() const; +#endif private: + FixedSizeAlignedSecBlock m_state; int m_rounds; - FixedSizeSecBlock m_state; }; -//! Salsa20, variable rounds: 8, 12 or 20 (default 20) +/// Salsa20, variable rounds: 8, 12 or 20 (default 20) struct Salsa20 : public Salsa20_Info, public SymmetricCipherDocumentation { typedef SymmetricCipherFinal >, Salsa20_Info> Encryption; -- cgit v1.2.1