diff options
author | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2007-05-05 18:29:44 +0000 |
---|---|---|
committer | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2007-05-05 18:29:44 +0000 |
commit | 7ae0bd42ae6dc01e6516d7be946faa8b9947c923 (patch) | |
tree | 815b3a4082fcff80f39864538fd1baa08e44f28a /vmac.cpp | |
parent | 6a8dddea4e0a89e44d15a2a28a5398bb67cafdda (diff) | |
download | cryptopp-7ae0bd42ae6dc01e6516d7be946faa8b9947c923.tar.gz |
fix compile on Turbo C++ 2006
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@365 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'vmac.cpp')
-rwxr-xr-x | vmac.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -13,12 +13,17 @@ NAMESPACE_BEGIN(CryptoPP) #endif #define VMAC_BOOL_WORD128 (defined(CRYPTOPP_WORD128_AVAILABLE) && !defined(CRYPTOPP_X64_ASM_AVAILABLE)) - +#ifdef __BORLANDC__ +#define const // Turbo C++ 2006 workaround +#endif static const word64 p64 = W64LIT(0xfffffffffffffeff); /* 2^64 - 257 prime */ static const word64 m62 = W64LIT(0x3fffffffffffffff); /* 62-bit mask */ static const word64 m63 = W64LIT(0x7fffffffffffffff); /* 63-bit mask */ static const word64 m64 = W64LIT(0xffffffffffffffff); /* 64-bit mask */ static const word64 mpoly = W64LIT(0x1fffffff1fffffff); /* Poly key mask */ +#ifdef __BORLANDC__ +#undef const +#endif #if VMAC_BOOL_WORD128 static const word128 m126 = (word128(m62)<<64)|m64; /* 126-bit mask */ #endif @@ -55,7 +60,7 @@ void VMAC_Base::UncheckedSetKey(const byte *userKey, unsigned int keylength, con } /* Fill poly key */ - in[0] = 0xC0; + in[0] = 0xC0; in[15] = 0; for (i = 0; i <= (size_t)m_is128; i++) { @@ -68,14 +73,15 @@ void VMAC_Base::UncheckedSetKey(const byte *userKey, unsigned int keylength, con /* Fill ip key */ in[0] = 0xE0; in[15] = 0; + word64 *l3Key = m_l3Key(); for (i = 0; i <= (size_t)m_is128; i++) do { cipher.ProcessBlock(in, out.BytePtr()); - m_l3Key()[i*2+0] = GetWord<word64>(true, BIG_ENDIAN_ORDER, out.BytePtr()); - m_l3Key()[i*2+1] = GetWord<word64>(true, BIG_ENDIAN_ORDER, out.BytePtr()+8); + l3Key[i*2+0] = GetWord<word64>(true, BIG_ENDIAN_ORDER, out.BytePtr()); + l3Key[i*2+1] = GetWord<word64>(true, BIG_ENDIAN_ORDER, out.BytePtr()+8); in[15]++; - } while ((m_l3Key()[0] >= p64) || (m_l3Key()[1] >= p64)); + } while ((l3Key[i*2+0] >= p64) || (l3Key[i*2+1] >= p64)); m_padCached = false; Resynchronize(GetIVAndThrowIfInvalid(params)); |