Fix SHA512 and optimize BN for mingw64.
authorAndy Polyakov <appro@openssl.org>
Sat, 1 Nov 2008 12:46:18 +0000 (12:46 +0000)
committerAndy Polyakov <appro@openssl.org>
Sat, 1 Nov 2008 12:46:18 +0000 (12:46 +0000)
crypto/bn/bn_lcl.h
crypto/sha/sha512.c

index 27ac4397a15172016e093f924e9d9b7ab997442a..8e5e98e3f2b87fd80a1d33511df3ba495e60414a 100644 (file)
@@ -255,7 +255,8 @@ extern "C" {
             : "r"(a), "r"(b));         \
        ret;                    })
 #  endif       /* compiler */
             : "r"(a), "r"(b));         \
        ret;                    })
 #  endif       /* compiler */
-# elif defined(__x86_64) && defined(SIXTY_FOUR_BIT_LONG)
+# elif (defined(__x86_64) || defined(__x86_64__)) && \
+       (defined(SIXTY_FOUR_BIT_LONG) || defined(SIXTY_FOUR_BIT))
 #  if defined(__GNUC__)
 #   define BN_UMULT_HIGH(a,b)  ({      \
        register BN_ULONG ret,discard;  \
 #  if defined(__GNUC__)
 #   define BN_UMULT_HIGH(a,b)  ({      \
        register BN_ULONG ret,discard;  \
index 2284eefc8f86e95cce42bc373813db807f27e55b..86115d890d5e563fccd3877189294d29a81f8232 100644 (file)
@@ -350,7 +350,7 @@ static const SHA_LONG64 K512[80] = {
 #ifndef PEDANTIC
 # if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
 #  if defined(__x86_64) || defined(__x86_64__)
 #ifndef PEDANTIC
 # if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
 #  if defined(__x86_64) || defined(__x86_64__)
-#   define ROTR(a,n)   ({ unsigned long ret;           \
+#   define ROTR(a,n)   ({ SHA_LONG64 ret;              \
                                asm ("rorq %1,%0"       \
                                : "=r"(ret)             \
                                : "J"(n),"0"(a)         \
                                asm ("rorq %1,%0"       \
                                : "=r"(ret)             \
                                : "J"(n),"0"(a)         \
@@ -387,6 +387,7 @@ static const SHA_LONG64 K512[80] = {
 #  endif
 # elif defined(_MSC_VER)
 #  if defined(_WIN64)  /* applies to both IA-64 and AMD64 */
 #  endif
 # elif defined(_MSC_VER)
 #  if defined(_WIN64)  /* applies to both IA-64 and AMD64 */
+#   pragma intrinsic(_rotr64)
 #   define ROTR(a,n)   _rotr64((a),n)
 #  endif
 #  if defined(_M_IX86) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
 #   define ROTR(a,n)   _rotr64((a),n)
 #  endif
 #  if defined(_M_IX86) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)