Module Make.UTIL
Cryptographic helpers used in KBB2017
val xHKDF : t -> t -> t -> t arrayxHKDF ikm salt infoextracts a pseudo-random key from the input keying materialikmand asaltand expands it to derive two derivative keys from an optional application- and context-specificinfousing the RFC 5869 HMAC-based Extract-and-Expand Key Derivation Function construction.- returns
an array
[| k0; k1 |]wherek0is the derivative key from the first expansion andk1is the derivative key from the second expansion
val xQDHInit : t -> t -> t -> t -> t -> txQDHInit myIdentityKeyPriv myInitEphemeralKeyPriv theirIdentityKeyPub theirSignedPreKeyPub theirPreKeyPubperforms the quad Diffie-Helman construction for "Sending the initial message" of the X3DH Key Agreement Protocol.
val xQDHResp : t -> t -> t -> t -> t -> txQDHInit myIdentityKeyPriv mySignedPreKeyPriv myPreKeyPriv theirIdentityKeyPub theirEphemeralKeyPubperforms the quad Diffie-Helman construction for "Receiving the initial message" of the X3DH Key Agreement Protocol.
val newIdentityKey : t -> t Dirsp_exchange_kbb2017__.Kobeissi_bhargavan_blanchet_intf.record_keypairnewIdentityKey idcreates a key pair with a randomly initialized 32 byte private key and its 32 bytes ED25519 public key.idwill be ignored for a true random number generator. Butidmay be used for mock random number generators or pseudo random generators to provide repeatability.
val newKeyPair : t -> t Dirsp_exchange_kbb2017__.Kobeissi_bhargavan_blanchet_intf.record_keypairnewKeyPair idcreates a key pair with a randomly initialized 32 byte private key and its 32 byte DH25519 (aka x25519) public key.idwill be ignored for a true random number generator. Butidmay be used for mock random number generators or pseudo random generators to provide repeatability.