Module Make.UTIL
Cryptographic helpers used in KBB2017
val xHKDF : t -> t -> t -> t array
xHKDF ikm salt info
extracts a pseudo-random key from the input keying materialikm
and asalt
and expands it to derive two derivative keys from an optional application- and context-specificinfo
using the RFC 5869 HMAC-based Extract-and-Expand Key Derivation Function construction.- returns
an array
[| k0; k1 |]
wherek0
is the derivative key from the first expansion andk1
is the derivative key from the second expansion
val xQDHInit : t -> t -> t -> t -> t -> t
xQDHInit myIdentityKeyPriv myInitEphemeralKeyPriv theirIdentityKeyPub theirSignedPreKeyPub theirPreKeyPub
performs the quad Diffie-Helman construction for "Sending the initial message" of the X3DH Key Agreement Protocol.
val xQDHResp : t -> t -> t -> t -> t -> t
xQDHInit myIdentityKeyPriv mySignedPreKeyPriv myPreKeyPriv theirIdentityKeyPub theirEphemeralKeyPub
performs 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_keypair
newIdentityKey id
creates a key pair with a randomly initialized 32 byte private key and its 32 bytes ED25519 public key.id
will be ignored for a true random number generator. Butid
may 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_keypair
newKeyPair id
creates a key pair with a randomly initialized 32 byte private key and its 32 byte DH25519 (aka x25519) public key.id
will be ignored for a true random number generator. Butid
may be used for mock random number generators or pseudo random generators to provide repeatability.