package dirsp-exchange-kbb2017

  1. Overview
  2. Docs

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 material ikm and a salt and expands it to derive two derivative keys from an optional application- and context-specific info using the RFC 5869 HMAC-based Extract-and-Expand Key Derivation Function construction.

  • returns

    an array [| k0; k1 |] where k0 is the derivative key from the first expansion and k1 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. But id 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. But id may be used for mock random number generators or pseudo random generators to provide repeatability.

val getDHPublicKey : t -> t

getDHPublicKey priv gives the DH25519 public key corresponding to the private key priv

OCaml

Innovation. Community. Security.