Skip to content
This repository was archived by the owner on Jan 9, 2026. It is now read-only.

Commit d736a9c

Browse files
committed
Forward compatbility for latest version of hashes
1 parent ebad60e commit d736a9c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Crypto/Hash/Keccak256Native.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import Control.Exception (Exception(..), SomeException(..), try)
1414
import Control.Monad (forM_)
1515
import Control.Monad.Catch (throwM)
1616
import Data.ByteString.Short qualified as BSS
17+
import Data.Coerce
1718
import Data.Hash.Class.Mutable (initialize, finalize, updateByteString)
1819
import Data.Hash.Internal.OpenSSL (OpenSslException(..))
1920
import Data.Hash.Keccak (Keccak256(..))
@@ -41,7 +42,7 @@ keccak256 strings = unsafePerformIO $ do
4142
Right bytes -> do
4243
updateByteString @Keccak256 ctx bytes
4344
Keccak256 hash <- finalize ctx
44-
pure (BSS.fromShort hash)
45+
pure (BSS.fromShort $ coerce hash)
4546
case e of
4647
Left err
4748
| Just (OpenSslException msg) <- fromException err -> pure (Left (Keccak256OpenSslException msg))

0 commit comments

Comments
 (0)