Clear alignment warnings on ARM 32-bit platforms

This commit is contained in:
Jeffrey Walton 2019-05-01 12:54:25 -04:00
parent 337d1c88c8
commit 30fc56d58c
No known key found for this signature in database
GPG Key ID: B36AB348921B1838

View File

@ -15,6 +15,14 @@
# pragma warning(disable: 4146 4242 4244 4245)
#endif
// Can't use GetAlignmentOf<word32>() because of C++11 and constexpr
// Can use 'const unsigned int' because of MSVC 2013
#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64)
# define ALIGN_SPEC 16
#else
# define ALIGN_SPEC 4
#endif
#ifndef CRYPTOPP_DISABLE_NACL
NAMESPACE_BEGIN(CryptoPP)
@ -417,7 +425,7 @@ static void pow2523(gf o,const gf i)
// https://github.com/jedisct1/libsodium/blob/master/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c
static int has_small_order(const byte s[32])
{
CRYPTOPP_ALIGN_DATA(16)
CRYPTOPP_ALIGN_DATA(ALIGN_SPEC)
const byte blacklist[][32] = {
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },