diff options
author | weidai <weidai11@users.noreply.github.com> | 2009-03-02 02:39:17 +0000 |
---|---|---|
committer | weidai <weidai11@users.noreply.github.com> | 2009-03-02 02:39:17 +0000 |
commit | d8a644fc4ee2af9dc62f2a8c167b023d0c71d13b (patch) | |
tree | 0fecaa7a6728d07549a41864ea2cedfb245f0bd3 /sosemanuk.cpp | |
parent | fa25129ac981ceed9569496c02b83771b394fa40 (diff) | |
download | cryptopp-git-d8a644fc4ee2af9dc62f2a8c167b023d0c71d13b.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
Diffstat (limited to 'sosemanuk.cpp')
-rwxr-xr-x | sosemanuk.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sosemanuk.cpp b/sosemanuk.cpp index 1f9bde41..e0e411f1 100755 --- a/sosemanuk.cpp +++ b/sosemanuk.cpp @@ -23,8 +23,10 @@ void SosemanukPolicy::CipherSetKey(const NameValuePairs ¶ms, 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)\ |