summaryrefslogtreecommitdiff
path: root/gcm.cpp
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2009-03-15 03:53:58 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2009-03-15 03:53:58 +0000
commitf458268c79d1c37b27eec83ac8247d8c292b12ab (patch)
treeb44599a84f8936aeb1175ede422f778e614f4c36 /gcm.cpp
parent02df6c04ecd6ac6ca2580c23dd4282a556cd55c5 (diff)
downloadcryptopp-f458268c79d1c37b27eec83ac8247d8c292b12ab.tar.gz
fix compile on MSVC 6 and MSVC 2003
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@457 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'gcm.cpp')
-rw-r--r--gcm.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcm.cpp b/gcm.cpp
index 4d20011..986aa2a 100644
--- a/gcm.cpp
+++ b/gcm.cpp
@@ -80,6 +80,11 @@ void GCM_Base::SetKeyWithoutResync(const byte *userKey, size_t keylength, const
else
tableSize = (GetTablesOption() == GCM_64K_Tables) ? 64*1024 : 2*1024;
+#if defined(_MSC_VER) && (_MSC_VER >= 1300 && _MSC_VER < 1400)
+ // VC 2003 workaround: compiler generates bad code for 64K tables
+ tableSize = 2*1024;
+#endif
+
m_buffer.resize(3*REQUIRED_BLOCKSIZE + tableSize);
byte *hashKey = HashKey();
memset(hashKey, 0, REQUIRED_BLOCKSIZE);
@@ -409,7 +414,7 @@ size_t GCM_Base::AuthenticateBlocks(const byte *data, size_t len)
AS2( shr WORD_REG(dx), 4 )
#endif
- #if !defined(_MSC_VER) || (_MSC_VER < 1300)
+ #if !defined(_MSC_VER) || (_MSC_VER < 1400)
AS_PUSH_IF86( bx)
#endif
AS_PUSH_IF86( bp)
@@ -519,7 +524,7 @@ size_t GCM_Base::AuthenticateBlocks(const byte *data, size_t len)
AS2( movdqa [WORD_REG(si)], xmm0 )
AS_POP_IF86( bp)
- #if !defined(_MSC_VER) || (_MSC_VER < 1300)
+ #if !defined(_MSC_VER) || (_MSC_VER < 1400)
AS_POP_IF86( bx)
#endif