sha512.c: there apparently is ILP32 PowerPC platform, where it is safe to
authorAndy Polyakov <appro@openssl.org>
Sun, 15 Nov 2009 17:19:49 +0000 (17:19 +0000)
committerAndy Polyakov <appro@openssl.org>
Sun, 15 Nov 2009 17:19:49 +0000 (17:19 +0000)
inline 64-bit assembler instructions. Normally it's inappropriate, because
signalling doesn't preserve upper halves of general purpose registers.
Meaning that it's only safe if signals are blocked for the time "wide"
code executes.
PR: 1998

crypto/sha/sha512.c

index d1aa761..cbc0e58 100644 (file)
@@ -380,7 +380,7 @@ static const SHA_LONG64 K512[80] = {
                                ((SHA_LONG64)hi)<<32|lo;        })
 #   endif
 #  elif (defined(_ARCH_PPC) && defined(__64BIT__)) || defined(_ARCH_PPC64)
-#   define ROTR(a,n)   ({ unsigned long ret;           \
+#   define ROTR(a,n)   ({ SHA_LONG64 ret;              \
                                asm ("rotrdi %0,%1,%2"  \
                                : "=r"(ret)             \
                                : "r"(a),"K"(n)); ret;  })