License | UNLICENSE |
---|---|
Maintainer | Keagan McClelland <keagan.mcclelland@gmail.com> |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
The API for this module may change at any time. This is an internal module only exposed for hacking and experimentation.
Synopsis
- data LCtx
- data Pubkey64
- data XonlyPubkey64
- data Keypair96
- data Msg32
- data RecSig65
- data Sig64
- data Compact64
- data Seed32
- data Seckey32
- data Tweak32
- data SchnorrExtra
- data Scratch
- data Bytes (n :: Nat)
- type CtxFlags = CUInt
- type SerFlags = CUInt
- type Ret = CInt
- type NonceFun a = Ptr CUChar -> Ptr CUChar -> Ptr CUChar -> Ptr CUChar -> Ptr a -> CInt -> IO CInt
- type NonceFunHardened a = Ptr CUChar -> Ptr CUChar -> CSize -> Ptr CUChar -> Ptr CUChar -> Ptr CUChar -> CSize -> Ptr a -> IO CInt
- type EcdhHashFun a = Ptr CUChar -> Ptr CUChar -> Ptr CUChar -> Ptr a -> IO CInt
- type Ctx = Ptr LCtx
- verify :: CtxFlags
- sign :: CtxFlags
- signVerify :: CtxFlags
- compressed :: SerFlags
- uncompressed :: SerFlags
- isSuccess :: Ret -> Bool
- unsafeUseByteString :: ByteString -> ((Ptr a, CSize) -> IO b) -> IO b
- useByteString :: ByteString -> ((Ptr a, CSize) -> IO b) -> IO b
- unsafePackByteString :: (Ptr a, CSize) -> IO ByteString
- packByteString :: (Ptr a, CSize) -> IO ByteString
- ctx :: Ctx
- contextClone :: Ctx -> IO Ctx
- contextCreate :: CtxFlags -> IO Ctx
- contextDestroy :: FunPtr (Ctx -> IO ())
- contextNoPrecomp :: Ctx
- contextPreallocatedClone :: Ctx -> Ptr (Bytes n) -> IO Ctx
- contextPreallocatedCloneSize :: Ctx -> IO CSize
- contextPreallocatedCreate :: Ptr (Bytes n) -> CUInt -> IO Ctx
- contextPreallocatedDestroy :: Ctx -> IO ()
- contextPreallocatedSize :: CUInt -> IO CSize
- contextRandomize :: Ctx -> Ptr Seed32 -> IO Ret
- setErrorCallback :: Ctx -> FunPtr (CString -> Ptr a -> IO ()) -> Ptr a -> IO ()
- setIllegalCallback :: Ctx -> FunPtr (CString -> Ptr a -> IO ()) -> Ptr a -> IO ()
- ecdh :: Ctx -> Ptr (Bytes n) -> Ptr Pubkey64 -> Ptr Seckey32 -> FunPtr (EcdhHashFun a) -> Ptr a -> IO Ret
- ecdhHashFunctionDefault :: FunPtr (EcdhHashFun a)
- ecdhHashSha256 :: FunPtr (EcdhHashFun a)
- ecdsaRecover :: Ctx -> Ptr Pubkey64 -> Ptr RecSig65 -> Ptr Msg32 -> IO Ret
- ecdsaRecoverableSignatureConvert :: Ctx -> Ptr Sig64 -> Ptr RecSig65 -> IO Ret
- ecdsaRecoverableSignatureParseCompact :: Ctx -> Ptr RecSig65 -> Ptr (Bytes 64) -> CInt -> IO Ret
- ecdsaRecoverableSignatureSerializeCompact :: Ctx -> Ptr (Bytes 64) -> Ptr CInt -> Ptr RecSig65 -> IO Ret
- ecdsaSign :: Ctx -> Ptr Sig64 -> Ptr Msg32 -> Ptr Seckey32 -> FunPtr (NonceFun a) -> Ptr a -> IO Ret
- ecdsaSignatureNormalize :: Ctx -> Ptr Sig64 -> Ptr Sig64 -> IO Ret
- ecdsaSignatureParseCompact :: Ctx -> Ptr Sig64 -> Ptr Compact64 -> IO Ret
- ecdsaSignatureParseDer :: Ctx -> Ptr Sig64 -> Ptr (Bytes n) -> CSize -> IO Ret
- ecdsaSignatureSerializeCompact :: Ctx -> Ptr Compact64 -> Ptr Sig64 -> IO Ret
- ecdsaSignatureSerializeDer :: Ctx -> Ptr (Bytes n) -> Ptr CSize -> Ptr Sig64 -> IO Ret
- ecdsaSignRecoverable :: Ctx -> Ptr RecSig65 -> Ptr Msg32 -> Ptr Seckey32 -> FunPtr (NonceFun a) -> Ptr a -> IO Ret
- ecdsaVerify :: Ctx -> Ptr Sig64 -> Ptr Msg32 -> Ptr Pubkey64 -> IO Ret
- ecPrivkeyNegate :: Ctx -> Ptr Tweak32 -> IO Ret
- ecPrivkeyTweakAdd :: Ctx -> Ptr Seckey32 -> Ptr Tweak32 -> IO Ret
- ecPrivkeyTweakMul :: Ctx -> Ptr Seckey32 -> Ptr Tweak32 -> IO Ret
- ecPubkeyCmp :: Ctx -> Ptr Pubkey64 -> Ptr Pubkey64
- ecPubKeyCombine :: Ctx -> Ptr Pubkey64 -> Ptr (Ptr Pubkey64) -> CInt -> IO Ret
- ecPubKeyCreate :: Ctx -> Ptr Pubkey64 -> Ptr Seckey32 -> IO Ret
- ecPubkeyNegate :: Ctx -> Ptr Pubkey64 -> IO Ret
- ecPubkeyParse :: Ctx -> Ptr Pubkey64 -> Ptr (Bytes n) -> CSize -> IO Ret
- ecPubKeySerialize :: Ctx -> Ptr (Bytes n) -> Ptr CSize -> Ptr Pubkey64 -> SerFlags -> IO Ret
- ecPubKeyTweakAdd :: Ctx -> Ptr Pubkey64 -> Ptr Tweak32 -> IO Ret
- ecPubKeyTweakMul :: Ctx -> Ptr Pubkey64 -> Ptr Tweak32 -> IO Ret
- ecSeckeyNegate :: Ctx -> Ptr Seckey32 -> IO Ret
- ecSeckeyTweakAdd :: Ctx -> Ptr Seckey32 -> Ptr Tweak32 -> IO Ret
- ecSeckeyTweakMul :: Ctx -> Ptr Seckey32 -> Ptr Tweak32 -> IO Ret
- ecSecKeyVerify :: Ctx -> Ptr Seckey32 -> IO Ret
- keypairCreate :: Ctx -> Ptr Keypair96 -> Ptr Seckey32 -> IO Ret
- keypairPub :: Ctx -> Ptr Pubkey64 -> Ptr Keypair96 -> IO Ret
- keypairSec :: Ctx -> Ptr Seckey32 -> Ptr Keypair96 -> IO Ret
- keypairXonlyPub :: Ctx -> Ptr XonlyPubkey64 -> Ptr CInt -> Ptr Keypair96 -> IO Ret
- keypairXonlyTweakAdd :: Ctx -> Ptr Keypair96 -> Ptr Tweak32 -> IO Ret
- nonceFunctionBip340 :: FunPtr (NonceFunHardened a)
- nonceFunctionDefault :: FunPtr (NonceFun a)
- nonceFunctionRfc6979 :: FunPtr (NonceFun a)
- schnorrsigSign :: Ctx -> Ptr Sig64 -> Ptr Msg32 -> Ptr Keypair96 -> Ptr (Bytes 32) -> IO Ret
- schnorrsigSignCustom :: Ctx -> Ptr Sig64 -> Ptr (Bytes n) -> CSize -> Ptr Keypair96 -> Ptr SchnorrExtra -> IO Ret
- schnorrSigSignVerify :: Ctx -> Ptr Sig64 -> Ptr (Bytes n) -> CSize -> Ptr XonlyPubkey64 -> IO Ret
- scratchSpaceCreate :: Ctx -> CSize -> IO (Ptr Scratch)
- scratchSpaceDestroy :: Ctx -> Ptr Scratch -> IO ()
- taggedSha256 :: Ctx -> Ptr (Bytes 32) -> Ptr (Bytes n) -> CSize -> Ptr (Bytes n) -> CSize -> IO Ret
- xonlyPubkeyCmp :: Ctx -> Ptr XonlyPubkey64 -> Ptr XonlyPubkey64 -> IO Ret
- xonlyPubkeyFromPubkey :: Ctx -> Ptr XonlyPubkey64 -> Ptr CInt -> Ptr Pubkey64 -> IO Ret
- xonlyPubkeyParse :: Ctx -> Ptr XonlyPubkey64 -> Ptr (Bytes 32) -> IO Ret
- xonlyPubkeySerialize :: Ctx -> Ptr (Bytes 32) -> Ptr XonlyPubkey64 -> IO Ret
- xonlyPubkeyTweakAdd :: Ctx -> Ptr Pubkey64 -> Ptr XonlyPubkey64 -> Ptr Tweak32 -> IO Ret
- xonlyPubkeyTweakAddCheck :: Ctx -> Ptr (Bytes 32) -> CInt -> Ptr XonlyPubkey64 -> Ptr Tweak32 -> IO Ret
Documentation
data XonlyPubkey64 Source #
data SchnorrExtra Source #
type NonceFun a = Ptr CUChar -> Ptr CUChar -> Ptr CUChar -> Ptr CUChar -> Ptr a -> CInt -> IO CInt Source #
type NonceFunHardened a = Ptr CUChar -> Ptr CUChar -> CSize -> Ptr CUChar -> Ptr CUChar -> Ptr CUChar -> CSize -> Ptr a -> IO CInt Source #
unsafeUseByteString :: ByteString -> ((Ptr a, CSize) -> IO b) -> IO b Source #
useByteString :: ByteString -> ((Ptr a, CSize) -> IO b) -> IO b Source #
unsafePackByteString :: (Ptr a, CSize) -> IO ByteString Source #
packByteString :: (Ptr a, CSize) -> IO ByteString Source #
contextPreallocatedDestroy :: Ctx -> IO () Source #
ecdh :: Ctx -> Ptr (Bytes n) -> Ptr Pubkey64 -> Ptr Seckey32 -> FunPtr (EcdhHashFun a) -> Ptr a -> IO Ret Source #
ecdhHashSha256 :: FunPtr (EcdhHashFun a) Source #
ecdsaRecoverableSignatureParseCompact :: Ctx -> Ptr RecSig65 -> Ptr (Bytes 64) -> CInt -> IO Ret Source #
ecdsaRecoverableSignatureSerializeCompact :: Ctx -> Ptr (Bytes 64) -> Ptr CInt -> Ptr RecSig65 -> IO Ret Source #
ecdsaSignRecoverable :: Ctx -> Ptr RecSig65 -> Ptr Msg32 -> Ptr Seckey32 -> FunPtr (NonceFun a) -> Ptr a -> IO Ret Source #
ecPrivkeyTweakAdd :: Ctx -> Ptr Seckey32 -> Ptr Tweak32 -> IO Ret Source #
Deprecated: use ecSeckeyTweakAdd instead
ecPrivkeyTweakMul :: Ctx -> Ptr Seckey32 -> Ptr Tweak32 -> IO Ret Source #
Deprecated: use ecSeckeyTweakMul instead
nonceFunctionDefault :: FunPtr (NonceFun a) Source #
nonceFunctionRfc6979 :: FunPtr (NonceFun a) Source #
schnorrsigSign :: Ctx -> Ptr Sig64 -> Ptr Msg32 -> Ptr Keypair96 -> Ptr (Bytes 32) -> IO Ret Source #
schnorrsigSignCustom :: Ctx -> Ptr Sig64 -> Ptr (Bytes n) -> CSize -> Ptr Keypair96 -> Ptr SchnorrExtra -> IO Ret Source #
schnorrSigSignVerify :: Ctx -> Ptr Sig64 -> Ptr (Bytes n) -> CSize -> Ptr XonlyPubkey64 -> IO Ret Source #
taggedSha256 :: Ctx -> Ptr (Bytes 32) -> Ptr (Bytes n) -> CSize -> Ptr (Bytes n) -> CSize -> IO Ret Source #
xonlyPubkeyCmp :: Ctx -> Ptr XonlyPubkey64 -> Ptr XonlyPubkey64 -> IO Ret Source #
xonlyPubkeyParse :: Ctx -> Ptr XonlyPubkey64 -> Ptr (Bytes 32) -> IO Ret Source #
xonlyPubkeySerialize :: Ctx -> Ptr (Bytes 32) -> Ptr XonlyPubkey64 -> IO Ret Source #