Closed
Description
I made it work with this:
-- Function to extract ByteString from Signature
signatureToByteString :: Signature -> IO BS.ByteString
signatureToByteString (Signature (S.Signature fptr)) =
withForeignPtr fptr $ \ptr -> BS.create sigSize $ \destPtr -> do
let bytePtr = castPtr ptr :: Ptr Word8 -- Cast Ptr Prim.Sig64 to Ptr Word8
bytes <- peekArray sigSize bytePtr -- Read the bytes from the casted pointer
-- Copy bytes into destination pointer
mapM_ (\(i, b) -> pokeElemOff destPtr i b) (zip [0..] bytes)
using ecdsaSignatureSerializeCompact gives wrong results.
Metadata
Metadata
Assignees
Labels
No labels