From d736a9cc154716274db2d45e94a8cc8ded596b8a Mon Sep 17 00:00:00 2001 From: Lars Kuhtz Date: Wed, 12 Mar 2025 23:08:15 -0700 Subject: [PATCH] Forward compatbility for latest version of hashes --- src/Crypto/Hash/Keccak256Native.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Crypto/Hash/Keccak256Native.hs b/src/Crypto/Hash/Keccak256Native.hs index 74ac2a236..d1c468d90 100644 --- a/src/Crypto/Hash/Keccak256Native.hs +++ b/src/Crypto/Hash/Keccak256Native.hs @@ -14,6 +14,7 @@ import Control.Exception (Exception(..), SomeException(..), try) import Control.Monad (forM_) import Control.Monad.Catch (throwM) import Data.ByteString.Short qualified as BSS +import Data.Coerce import Data.Hash.Class.Mutable (initialize, finalize, updateByteString) import Data.Hash.Internal.OpenSSL (OpenSslException(..)) import Data.Hash.Keccak (Keccak256(..)) @@ -41,7 +42,7 @@ keccak256 strings = unsafePerformIO $ do Right bytes -> do updateByteString @Keccak256 ctx bytes Keccak256 hash <- finalize ctx - pure (BSS.fromShort hash) + pure (BSS.fromShort $ coerce hash) case e of Left err | Just (OpenSslException msg) <- fromException err -> pure (Left (Keccak256OpenSslException msg))