Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

segfault in blake2_update #193

Description

@domenkozar

We found a segfault in blake2_update function and @vincenthz provided a workaround patch:

diff --git a/Crypto/Hash/Blake2b.hs b/Crypto/Hash/Blake2b.hs
index c22c284..19c68ba 100644
--- a/Crypto/Hash/Blake2b.hs
+++ b/Crypto/Hash/Blake2b.hs
@@ -85,7 +85,7 @@ instance HashAlgorithm Blake2b_512 where
 foreign import ccall unsafe "cryptonite_blake2b_init"
     c_blake2b_init :: Ptr (Context a) -> Word32 -> IO ()

-foreign import ccall "cryptonite_blake2b_update"
+foreign import ccall unsafe "cryptonite_blake2b_update"
     c_blake2b_update :: Ptr (Context a) -> Ptr Word8 -> Word32 -> IO ()

 foreign import ccall unsafe "cryptonite_blake2b_finalize"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions