diff --git a/Crypto/Internal/CompatPrim.hs b/Crypto/Internal/CompatPrim.hs index 48b67cc..5822024 100644 --- a/Crypto/Internal/CompatPrim.hs +++ b/Crypto/Internal/CompatPrim.hs @@ -58,8 +58,9 @@ byteswap32Prim w = #endif -- | combine 4 word8 [a,b,c,d] to a word32 representing [a,b,c,d] -convert4To32 :: (# Word#, Word#, Word#, Word# #) -> Word# -convert4To32 (# a, b, c, d #) = or# (or# c1 c2) (or# c3 c4) +convert4To32 :: Word# -> Word# -> Word# -> Word# + -> Word# +convert4To32 a b c d = or# (or# c1 c2) (or# c3 c4) where #ifdef ARCH_IS_LITTLE_ENDIAN !c1 = uncheckedShiftL# a 24# diff --git a/Crypto/Internal/Hex.hs b/Crypto/Internal/Hex.hs index 1c12b67..5b48c00 100644 --- a/Crypto/Internal/Hex.hs +++ b/Crypto/Internal/Hex.hs @@ -87,7 +87,7 @@ toHexadecimal4 bout bin n = loop 0 loop (i+2) convertByte4 :: Word# -> Word# -> Word# -convertByte4 a b = convert4To32 (# b2, b1, a2, a1 #) +convertByte4 a b = convert4To32 b2 b1 a2 a1 where !(# a1, a2 #) = convertByte a !(# b1, b2 #) = convertByte b