summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2007-05-24 20:24:30 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2007-05-24 20:24:30 +0000
commit3642ae045b31462ee9d8e912a035a664957cb880 (patch)
tree47094798eb4f3dadba26213b9d2dfe86a9f1e3ef
parentd503bdbc01635fce145e3f3cd73ae0fc3a57490f (diff)
downloadcryptopp-3642ae045b31462ee9d8e912a035a664957cb880.tar.gz
fix bug on 32-bit big-endian machines
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk@373 57ff6487-cd31-0410-9ec3-f628ee90f5f0
-rwxr-xr-xc5/vmac.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/c5/vmac.cpp b/c5/vmac.cpp
index 67f0074..2e7a4f5 100755
--- a/c5/vmac.cpp
+++ b/c5/vmac.cpp
@@ -512,15 +512,15 @@ void VMAC_Base::VHASH_Update_Template(const word64 *data, size_t blocksRemaining
nh2[1] = (nhB2 + (nhB1 >> 32)) & m62;
}
- #define a0 (((word32 *)(polyS+i*4))[2])
- #define a1 (((word32 *)(polyS+i*4))[3])
- #define a2 (((word32 *)(polyS+i*4))[0])
- #define a3 (((word32 *)(polyS+i*4))[1])
+ #define a0 (((word32 *)(polyS+i*4))[2+NativeByteOrder::ToEnum()])
+ #define a1 (((word32 *)(polyS+i*4))[3-NativeByteOrder::ToEnum()])
+ #define a2 (((word32 *)(polyS+i*4))[0+NativeByteOrder::ToEnum()])
+ #define a3 (((word32 *)(polyS+i*4))[1-NativeByteOrder::ToEnum()])
#define aHi ((polyS+i*4)[0])
- #define k0 (((word32 *)(polyS+i*4+2))[2])
- #define k1 (((word32 *)(polyS+i*4+2))[3])
- #define k2 (((word32 *)(polyS+i*4+2))[0])
- #define k3 (((word32 *)(polyS+i*4+2))[1])
+ #define k0 (((word32 *)(polyS+i*4+2))[2+NativeByteOrder::ToEnum()])
+ #define k1 (((word32 *)(polyS+i*4+2))[3-NativeByteOrder::ToEnum()])
+ #define k2 (((word32 *)(polyS+i*4+2))[0+NativeByteOrder::ToEnum()])
+ #define k3 (((word32 *)(polyS+i*4+2))[1-NativeByteOrder::ToEnum()])
#define kHi ((polyS+i*4+2)[0])
if (isFirstBlock)