Module Crypto.ED25519
type t= tThe type that will be used to represent contiguous bytes; typically either Bytes.t or Cstruct.t
val publicKey : t -> tpublicKey skcomputes the 32-byte ED25519 public key for the secret keysk.- raises Crypto_failure
when the secret key is not 32 bytes
val checkValid : t -> t -> t -> boolcheckValid s m pkchecks the messagemfor a valid signaturessigned by the private key that corresponds to the raw public keypk.- raises Crypto_failure
when the signature is not 64 bytes or the public key is not 32 bytes
val signature : t -> t -> t -> tsignature m sk pkcalculates the ED25519 signature ofmwith a raw 32-byte secret keyskand its corresponding raw 32-byte public keypkcreated with(publicKeysk.WARNING: It is incorrect to create a ED25519 signature using a public key
pkthat is not derived from the secret keysk. You provide thepksimply because doing so is the ProScript API, and because it can be a performance win to not recomputepublicKeyeach time you do a signature.1. You need to hex encode the message.
Checks may or may not be performed to verify you gave the correct public key. Implementations have the freedom to ignore whatever public key you provide (ex.
dirsp-proscript-miragewill recompute the public key and ignore your public key).- raises Crypto_failure
when the secret or public key is not 32 bytes