Module Hieroglyphs
Quantum-resistant, purely Hash-based, Stateful, One-Time Digital Signatures for OCaml.
- author
- Marco Aurélio da Silva
- version
- 0.0.1
val generate : unit -> privGenerates an unique private key.
val export : priv:priv -> pass:string -> stringexport ~priv ~passdumps an encrypted version of the private key.
val import : cipher:string -> pass:string -> priv optionimport ~cipher ~passtries to load a previously exported private key, only if the cipher text and the password yield a valid, internally parseable private key.
val load : string -> pub optionload textparses a valid public key, otherwise, returns None.
val show : pub -> stringshow pubkeydumps/serialize a public key under string format.
val address : pub -> stringaddress pubkeygenerates an unique, deterministic ID for given public key. It's useful, for instance, to externally track the used/consumed private keys with a maintained state under a blacklist, cause there's an unique mapping from priv to pub, and therefore, from priv to id : string (the composition ofderivewithaddress.
val sign : priv:priv -> msg:string -> string optionsign ~priv ~msgcreates a deterministic string signature given the same private key and same message. Fails if the private key was already used previously to sign a message, even if the message was the same (TODO: it's safe to sign many times the same message, 'cause it still makes inversion/prediction attacks impossible).
val verify : pub:pub -> msg:string -> signature:string -> boolverify ~pub ~msg ~signaturesucceeds if the signature is valid for given message and was generated by the private key which generated the given public key.