package hacl

  1. Overview
  2. Docs
type combined
type _ key
val skbytes : int
val pkbytes : int
val ckbytes : int
val zerobytes : int
val boxzerobytes : int
val equal : 'a key -> 'a key -> bool
val unsafe_to_bytes : _ key -> Bigstring.t

unsafe_to_bytes k is the internal Bigstring.t where the key is stored. DO NOT MODIFY.

val blit_to_bytes : _ key -> ?pos:int -> Bigstring.t -> unit
val unsafe_sk_of_bytes : Bigstring.t -> secret key
val unsafe_pk_of_bytes : Bigstring.t -> public key
val unsafe_ck_of_bytes : Bigstring.t -> combined key
val of_seed : ?pos:int -> Bigstring.t -> secret key
  • raises Invalid_argument

    if pos is outside the buffer or the buffer is less than skbytes bytes long

val neuterize : secret key -> public key
val keypair : unit -> public key * secret key
val dh : public key -> secret key -> combined key
val box : k:combined key -> nonce:Bigstring.t -> msg:Bigstring.t -> cmsg:Bigstring.t -> unit
val box_open : k:combined key -> nonce:Bigstring.t -> cmsg:Bigstring.t -> msg:Bigstring.t -> bool