Crypto.SignSignatures.
The primitive is Ed25519 and SHA-512. NaCl documentation.
module Public_key : sig ... endPublic keys.
module Secret_key : sig ... endSecret keys.
val keypair : unit -> Public_key.t * Secret_key.tkeypair () randomly generates a secret key and its corresponding public key. The function blocks until enough entropy is gathered.
type plain_text = Bytes.tThe type for unsigned plain text.
type signed_text = Bytes.tThe type for signed text.
signed_text_max_overhead_length is the maximal additional number of bytes a signed text has over its plain text.
val sign : secret_key:Secret_key.t -> plain_text:plain_text -> signed_textsign ~secret_key ~plain_text is plain_text signed by secret_key.
val open' :
public_key:Public_key.t ->
signed_text:signed_text ->
plain_text optionopen' ~public_key ~signed_text is:
Some plain_text, if public_key successfully verifies the signature of signed_text. plain_text is the verified plain text.None if public_key fails to verify the signature of signed_text.