package secp256k1-internal

  1. Overview
  2. Docs
type secret
type public
type _ t
val buffer : _ t -> Bigstring.t

buffer k is the underlying buffer of k. DO NOT MODIFY.

val secret_bytes : int

Length of a secret key in memory: 32 bytes

val public_bytes : int

Length of a public key in memory: 64 bytes

val compressed_pk_bytes : int

Length of the compressed serialization of a public key: 33 bytes

val uncompressed_pk_bytes : int

Length of the uncompressed serialization of a public key: 65 bytes

val bytes : _ t -> int

bytes k is the length of k in memory (the length of the underlying Bigstring.t).

val serialized_bytes : ?compressed:bool -> _ t -> int

serialized_bytes ?compressed k is the length of the serialization (compressed) of k.

val equal : 'a t -> 'a t -> bool
val copy : 'a t -> 'a t

Aritmetic operations

val negate : Context.t -> 'a t -> 'a t
val add_tweak : Context.t -> 'a t -> Bigstring.t -> 'a t
val mul_tweak : Context.t -> 'a t -> Bigstring.t -> 'a t
val neuterize : Context.t -> _ t -> public t option
val neuterize_exn : Context.t -> _ t -> public t
val combine : Context.t -> _ t list -> public t option
val combine_exn : Context.t -> _ t list -> public t

Input/Output

val read_sk : Context.t -> Bigstring.t -> (secret t, string) result
val read_sk_exn : Context.t -> Bigstring.t -> secret t
val read_pk : Context.t -> Bigstring.t -> (public t, string) result
val read_pk_exn : Context.t -> Bigstring.t -> public t
val write : ?compress:bool -> Context.t -> ?pos:int -> Bigstring.t -> _ t -> int
val to_bytes : ?compress:bool -> Context.t -> _ t -> Bigstring.t