summaryrefslogtreecommitdiff
path: root/sosemanuk.cpp
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2009-03-02 02:39:17 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2009-03-02 02:39:17 +0000
commitcaf9e032e6b4ccb114a74a3936c916bcfaba262d (patch)
tree0fecaa7a6728d07549a41864ea2cedfb245f0bd3 /sosemanuk.cpp
parent4e4793cc591e26c788b53c487bee7cab2d377f5e (diff)
downloadcryptopp-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 'sosemanuk.cpp')
-rwxr-xr-xsosemanuk.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/sosemanuk.cpp b/sosemanuk.cpp
index 1f9bde4..e0e411f 100755
--- a/sosemanuk.cpp
+++ b/sosemanuk.cpp
@@ -23,8 +23,10 @@ void SosemanukPolicy::CipherSetKey(const NameValuePairs &params, const byte *use
Serpent_KeySchedule(m_key, 24, userKey, keylen);
}
-void SosemanukPolicy::CipherResynchronize(byte *keystreamBuffer, const byte *iv)
+void SosemanukPolicy::CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length)
{
+ assert(length==16);
+
word32 a, b, c, d, e;
typedef BlockGetAndPut<word32, LittleEndian> Block;
@@ -295,7 +297,7 @@ unsigned int SosemanukPolicy::GetAlignment() const
return 16;
else
#endif
- return 1;
+ return GetAlignmentOf<word32>();
}
unsigned int SosemanukPolicy::GetOptimalBlockSize() const
@@ -418,12 +420,15 @@ void SosemanukPolicy::OperateKeystream(KeystreamOperation operation, byte *outpu
#define R11 edx
#define R20 edx
#define R21 ecx
+// workaround bug in GAS 2.15
+#define R20r WORD_REG(dx)
+#define R21r WORD_REG(cx)
#define SSE2_STEP(i, j) \
AS2( mov eax, [s(i+0)])\
AS2( mov [v(i)], eax)\
AS2( rol eax, 8)\
- AS2( lea AS_REG_7d, [AS_REG_6d + R2##j])\
+ AS2( lea AS_REG_7, [AS_REG_6 + R2##j##r])\
AS2( xor AS_REG_7d, R1##j)\
AS2( mov [u(i)], AS_REG_7d)\
AS2( mov AS_REG_7d, 1)\