Fix SHA512 and optimize BN for mingw64.

This commit is contained in:
Andy Polyakov 2008-11-01 12:46:18 +00:00
parent 09a60c9833
commit 122396f2db
2 changed files with 4 additions and 2 deletions

View file

@ -255,7 +255,8 @@ extern "C" {
: "r"(a), "r"(b)); \ : "r"(a), "r"(b)); \
ret; }) ret; })
# endif /* compiler */ # 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__) # if defined(__GNUC__)
# define BN_UMULT_HIGH(a,b) ({ \ # define BN_UMULT_HIGH(a,b) ({ \
register BN_ULONG ret,discard; \ register BN_ULONG ret,discard; \

View file

@ -350,7 +350,7 @@ static const SHA_LONG64 K512[80] = {
#ifndef PEDANTIC #ifndef PEDANTIC
# if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) # if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
# if defined(__x86_64) || defined(__x86_64__) # 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" \ asm ("rorq %1,%0" \
: "=r"(ret) \ : "=r"(ret) \
: "J"(n),"0"(a) \ : "J"(n),"0"(a) \
@ -387,6 +387,7 @@ static const SHA_LONG64 K512[80] = {
# endif # endif
# elif defined(_MSC_VER) # elif defined(_MSC_VER)
# if defined(_WIN64) /* applies to both IA-64 and AMD64 */ # if defined(_WIN64) /* applies to both IA-64 and AMD64 */
# pragma intrinsic(_rotr64)
# define ROTR(a,n) _rotr64((a),n) # define ROTR(a,n) _rotr64((a),n)
# endif # endif
# if defined(_M_IX86) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) # if defined(_M_IX86) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)