Skip to content

Wrong export for schnorr signatures #8

Closed
@prolic

Description

@prolic

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

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