diff --git a/ec/native/curve25519_stubs.c b/ec/native/curve25519_stubs.c index 283a453a..e5fdab90 100644 --- a/ec/native/curve25519_stubs.c +++ b/ec/native/curve25519_stubs.c @@ -1,6 +1,9 @@ #include "mirage_crypto.h" -#ifdef ARCH_64BIT +/* Microsoft compiler does not support 128-bit integers. Drop down to + * 32-bit for MSVC. + */ +#if defined(ARCH_64BIT) && !defined(_MSC_VER) #include "curve25519_64.h" #define WORD uint64_t #define LIMBS 5 diff --git a/ec/native/np224_stubs.c b/ec/native/np224_stubs.c index fe64b5b4..dc29afea 100644 --- a/ec/native/np224_stubs.c +++ b/ec/native/np224_stubs.c @@ -1,6 +1,9 @@ #include "mirage_crypto.h" -#ifdef ARCH_64BIT +/* Microsoft compiler does not support 128-bit integers. Drop down to + * 32-bit for MSVC. + */ +#if defined(ARCH_64BIT) && !defined(_MSC_VER) #include "np224_64.h" #define LIMBS 4 #define WORD uint64_t diff --git a/ec/native/np256_stubs.c b/ec/native/np256_stubs.c index cd4aa30d..4da63dbc 100644 --- a/ec/native/np256_stubs.c +++ b/ec/native/np256_stubs.c @@ -1,6 +1,9 @@ #include "mirage_crypto.h" -#ifdef ARCH_64BIT +/* Microsoft compiler does not support 128-bit integers. Drop down to + * 32-bit for MSVC. + */ +#if defined(ARCH_64BIT) && !defined(_MSC_VER) #include "np256_64.h" #define LIMBS 4 #define WORD uint64_t diff --git a/ec/native/np384_stubs.c b/ec/native/np384_stubs.c index c1abd4e5..97893e06 100644 --- a/ec/native/np384_stubs.c +++ b/ec/native/np384_stubs.c @@ -1,6 +1,9 @@ #include "mirage_crypto.h" -#ifdef ARCH_64BIT +/* Microsoft compiler does not support 128-bit integers. Drop down to + * 32-bit for MSVC. + */ +#if defined(ARCH_64BIT) && !defined(_MSC_VER) #include "np384_64.h" #define LIMBS 6 #define WORD uint64_t diff --git a/ec/native/np521_stubs.c b/ec/native/np521_stubs.c index aaa8bf5a..39439309 100644 --- a/ec/native/np521_stubs.c +++ b/ec/native/np521_stubs.c @@ -1,6 +1,9 @@ #include "mirage_crypto.h" -#ifdef ARCH_64BIT +/* Microsoft compiler does not support 128-bit integers. Drop down to + * 32-bit for MSVC. + */ +#if defined(ARCH_64BIT) && !defined(_MSC_VER) #include "np521_64.h" #define LIMBS 9 #define WORD uint64_t diff --git a/ec/native/p224_stubs.c b/ec/native/p224_stubs.c index 0a5da891..2924901e 100644 --- a/ec/native/p224_stubs.c +++ b/ec/native/p224_stubs.c @@ -1,6 +1,9 @@ #include "mirage_crypto.h" -#ifdef ARCH_64BIT +/* Microsoft compiler does not support 128-bit integers. Drop down to + * 32-bit for MSVC. + */ +#if defined(ARCH_64BIT) && !defined(_MSC_VER) #include "p224_64.h" #define LIMBS 4 #define WORD uint64_t diff --git a/ec/native/p256_stubs.c b/ec/native/p256_stubs.c index 7dc2d927..ac611b6b 100644 --- a/ec/native/p256_stubs.c +++ b/ec/native/p256_stubs.c @@ -1,6 +1,9 @@ #include "mirage_crypto.h" -#ifdef ARCH_64BIT +/* Microsoft compiler does not support 128-bit integers. Drop down to + * 32-bit for MSVC. + */ +#if defined(ARCH_64BIT) && !defined(_MSC_VER) #include "p256_64.h" #define LIMBS 4 #define WORD uint64_t diff --git a/ec/native/p384_stubs.c b/ec/native/p384_stubs.c index 2b2efd2a..fec2e485 100644 --- a/ec/native/p384_stubs.c +++ b/ec/native/p384_stubs.c @@ -1,6 +1,9 @@ #include "mirage_crypto.h" -#ifdef ARCH_64BIT +/* Microsoft compiler does not support 128-bit integers. Drop down to + * 32-bit for MSVC. + */ +#if defined(ARCH_64BIT) && !defined(_MSC_VER) #include "p384_64.h" #define LIMBS 6 #define WORD uint64_t diff --git a/ec/native/p521_stubs.c b/ec/native/p521_stubs.c index e8d6764d..294aa058 100644 --- a/ec/native/p521_stubs.c +++ b/ec/native/p521_stubs.c @@ -1,6 +1,9 @@ #include "mirage_crypto.h" -#ifdef ARCH_64BIT +/* Microsoft compiler does not support 128-bit integers. Drop down to + * 32-bit for MSVC. + */ +#if defined(ARCH_64BIT) && !defined(_MSC_VER) #include "p521_64.h" #define LIMBS 9 #define WORD uint64_t diff --git a/src/native/ghash_ctmul.c b/src/native/ghash_ctmul.c index ebd6589d..32b7f9f8 100644 --- a/src/native/ghash_ctmul.c +++ b/src/native/ghash_ctmul.c @@ -39,6 +39,9 @@ #include "mirage_crypto.h" #include +/* Microsoft compiler does not support 128-bit integers. Drop down to + * 32-bit for MSVC. + */ #if defined (__i386__) || defined (__arm__) || defined(_MSC_VER) /*