diff options
author | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2009-03-02 02:39:17 +0000 |
---|---|---|
committer | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2009-03-02 02:39:17 +0000 |
commit | caf9e032e6b4ccb114a74a3936c916bcfaba262d (patch) | |
tree | 0fecaa7a6728d07549a41864ea2cedfb245f0bd3 /salsa.cpp | |
parent | 4e4793cc591e26c788b53c487bee7cab2d377f5e (diff) | |
download | cryptopp-caf9e032e6b4ccb114a74a3936c916bcfaba262d.tar.gz |
changes for 5.6:
- added AuthenticatedSymmetricCipher interface class and Filter wrappers
- added CCM, GCM (with SSE2 assembly), CMAC, and SEED
- improved AES speed on x86 and x64
- removed WORD64_AVAILABLE; compiler 64-bit int support is now required
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@433 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'salsa.cpp')
-rwxr-xr-x | salsa.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -30,9 +30,9 @@ void Salsa20_Policy::CipherSetKey(const NameValuePairs ¶ms, const byte *key, throw InvalidRounds(StaticAlgorithmName(), m_rounds); // m_state is reordered for SSE2 - GetBlock<word32, LittleEndian, false> get1(key); + GetBlock<word32, LittleEndian> get1(key); get1(m_state[13])(m_state[10])(m_state[7])(m_state[4]); - GetBlock<word32, LittleEndian, false> get2(key + length - 16); + GetBlock<word32, LittleEndian> get2(key + length - 16); get2(m_state[15])(m_state[12])(m_state[9])(m_state[6]); // "expand 16-byte k" or "expand 32-byte k" @@ -42,9 +42,10 @@ void Salsa20_Policy::CipherSetKey(const NameValuePairs ¶ms, const byte *key, m_state[3] = 0x6b206574; } -void Salsa20_Policy::CipherResynchronize(byte *keystreamBuffer, const byte *IV) +void Salsa20_Policy::CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length) { - GetBlock<word32, LittleEndian, false> get(IV); + assert(length==8); + GetBlock<word32, LittleEndian> get(IV); get(m_state[14])(m_state[11]); m_state[8] = m_state[5] = 0; } @@ -63,7 +64,7 @@ unsigned int Salsa20_Policy::GetAlignment() const return 16; else #endif - return 1; + return GetAlignmentOf<word32>(); } unsigned int Salsa20_Policy::GetOptimalBlockSize() const |