Library
Module
Module type
Parameter
Class
Class type
secret_key_of_string v
is secret key of a 32-bytes string
v
. It makes a fresh allocated secretkey
.
secret_key_of_string v
is secret key of a 32-bytes int array
v
. It only verifies v
(no allocation).
public_key_of_string v
is public key of 32-bytes string
v
. Null public key (String.make 32 '\x00'
) is not allowed. It makes a fresh allocated publickey
.
public_key_of_int_array v
is public key of 32-bytes int array
v
. It only verifies v
(no allocation). Null public key (Array.make 32 0
) is not allowed.
val string_of_key : _ key -> string
string_of_key k
makes a fresh allocated string
of k
.
ecdh_inplace ~out ~secret ~public
computes the shared secret between secret key secret
and public key public
. The result is stored in out
.
ecdh_base_inplace ~out ~secret
is eqauivalent to ecdh
with the secret key secret
and the base point base
, with the resulting public key stored in out
.
public_of_secret k
is public key of k
. It makes a fresh allocated public key.
shared ~secret ~public
computes the shared secret between secret key secret
and public key public
. It makes a fresh allocated result.
public_key_of_shared k
maps k
to be a public key.
secret_key_of_shared k
maps k
to be a secret key.
pp_shared_key ppf v
prints shared key v
on ppf
.