package secp256k1

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

Opaque data structured that holds a parsed ECDSA signature.

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

Parse an ECDSA signature in compact (64 bytes) format. Buffer must be 64 bytes long.

val of_der : Context.t -> buffer -> t option
val of_der_exn : Context.t -> buffer -> t

Parse a DER ECDSA signature.

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

Serialize an ECDSA signature in compact (64 byte) format.

val to_der : Context.t -> t -> buffer

Serialize an ECDSA signature in DER format.

val sign : Context.t -> seckey:Secret.t -> msg:buffer -> t

Create an ECDSA signature. The created signature is always in lower-S form. Buffer must contain a 32-byte message hash.

val verify : Context.t -> pubkey:Public.t -> msg:buffer -> signature:t -> bool

Verify an ECDSA signature. To avoid accepting malleable signatures, only ECDSA signatures in lower-S form are accepted.

OCaml

Innovation. Community. Security.