Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
Signature of cryptographic primitives and low-level functions needed by verified ProScript code.
The type that will be used to represent contiguous bytes; typically either Bytes.t or Cstruct.t
equal t_a t_b
is true if and only if the buffers t_a
and t_b
contain the same bytes
concat b_lst
take a list of buffers b_lst
, concatenates them together into one buffer
val of_string : string -> t
of_string s
converts a string s
into a buffer
of_elem_list elem_lst
concatenates a list of byte elements elem_lst
into a buffer
val of_cstruct : Cstruct.t -> t
of_cstruct cs
converts a Cstruct cs
into a buffer
val to_bytes : t -> Stdlib.Bytes.t
to_bytes b
converts a buffer b
into Bytes
elem_at b i
gives the byte element at the zero-based position i
of buffer b
val char_of_elem : t_elem -> char
char_of_elem e
converts a byte element e
to a character (a byte)
val elem_of_char : char -> t_elem
elem_of_char c
convert a byte c
into a buffer element
val hexdump : t -> unit
hexdump_pp b
gives a thunk that pretty-prints the buffer b
to standard output
val hexdump_pp : Stdlib.Format.formatter -> t -> unit
hexdump_pp fmt b
gives a thunk that pretty-prints the buffer b
to the formatter fmt
val t_from_protobuf : Protobuf.Decoder.t -> t
t_from_protobuf d
reads the next value from the protobuf decoder d
and converts it into a buffer
val t_to_protobuf : t -> Protobuf.Encoder.t -> unit
t_to_protobuf b e
creates a thunk which will encode the buffer b
with the protobuf encoder e
when called
Conversions back and forth between various encodings like hexadecimal.
module Crypto : PROSCRIPT_CRYPTO with type t = t
Core cryptographic primitives like SHA-256.