We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fdf8394 commit e92877aCopy full SHA for e92877a
src/Crypto/Secp256k1.hs
@@ -756,7 +756,9 @@ schnorrSign mGen KeyPair{..} bs
756
lift $ do
757
sigBuf <- mallocBytes 64
758
randomPtr <- case mGen of
759
- Just gen -> fmap castPtr $ BS.useAsCString (BS.pack $ Prelude.take 32 $ randoms gen) return
+ Just gen -> do
760
+ let randomBytes = BS.pack $ Prelude.take 32 $ randoms gen
761
+ BS.useAsCStringLen randomBytes $ \(ptr, _) -> pure $ castPtr ptr
762
Nothing -> pure nullPtr
763
ret <- Prim.schnorrsigSign ctx sigBuf msgHashPtr keyPairPtr randomPtr
764
if isSuccess ret
0 commit comments