package secp256k1

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type t

Opaque data structure that holds a parsed ECDSA recoverable signature.

val compare : t -> t -> int
val of_compact : Context.t -> recid:int -> ?pos:int -> buffer -> t option
val of_compact_exn : Context.t -> recid:int -> ?pos:int -> buffer -> t

Parse an ECDSA recoverable signature in compact (64 bytes) format. Buffer must be 64 bytes. The third argument is the recovery id.

val to_compact : Context.t -> t -> buffer * int

Serialize an ECDSA recoverable signature in compact (64 bytes) format. The returned int is the recovery id.

val write_compact : Context.t -> buffer -> ?pos:int -> t -> int

write_compact ctx buf ?pos signature writes signature at buf starting at pos in compact format.

val convert : Context.t -> t -> Sign.t

Convert an ECDSA recoverable signature into an ECDSA signature

val sign : Context.t -> seckey:Secret.t -> ?pos:int -> buffer -> t

Create an ECDSA recoverable signature. Buffer must contain a 32-byte message hash.

val write_sign : Context.t -> seckey:Secret.t -> outbuf:buffer -> ?outpos:int -> inbuf:buffer -> ?inpos:int -> unit -> int

write_sign ctx ~seckey ~outbuf ~outpos ~inbuf ~inpos () signs the message at inbuf starting at inpos and writes the signature at outbuf starting at outpos using seckey, and returns the number of bytes written.

val recover : Context.t -> t -> ?pos:int -> buffer -> Public.t option

Recover an ECDSA public key from a signature. Buffer must contain a 32-byte message hash.

OCaml

Innovation. Community. Security.