Module Make.TOPLEVEL
Entry point for sending and receiving messages while maintaining a KBB2017 session.
val newSession : t Dirsp_exchange_kbb2017__.Kobeissi_bhargavan_blanchet_intf.record_keypair -> t Dirsp_exchange_kbb2017__.Kobeissi_bhargavan_blanchet_intf.record_keypair -> t -> t -> t -> t -> t -> int -> t Dirsp_exchange_kbb2017__.Kobeissi_bhargavan_blanchet_intf.record_them
newSession mySignedPreKey myPreKey theirIdentityKeyPub theirIdentityDHKeyPub theirSignedPreKeyPub theirSignedPreKeySignature theirPreKeyPub preKeyId
creates a KBB2017 session from "my" prekeys and "their" public information while consuming a one-time pre-keypreKeyId
.Using nomenclature from the KBB2017 paper, the expectation is that the "their" party has published their long-term Diffie-Hellman public key
theirIdentityDHKeyPub
and a set of ephemeral Diffie-Hellman public keys (theirSignedPreKeyPub
andtheirPreKeyPub
) called "pre-keys" to a common server or other shared location. The pre-keys include both signed pre-keysmySignedPreKey
, which can be reused for some period of time, and non-signed, one-time pre-keys (myPreKey
and theirpreKeyId
), which are fresh at each session.
val send : t Dirsp_exchange_kbb2017__.Kobeissi_bhargavan_blanchet_intf.record_keypair -> t Dirsp_exchange_kbb2017__.Kobeissi_bhargavan_blanchet_intf.record_them -> t -> t Dirsp_exchange_kbb2017__.Kobeissi_bhargavan_blanchet_intf.record_sendoutput
send myIdentityKey them plaintext
sends aplaintext
message tothem
authenticated bymyIdentityKey
.
val recv : t Dirsp_exchange_kbb2017__.Kobeissi_bhargavan_blanchet_intf.record_keypair -> t Dirsp_exchange_kbb2017__.Kobeissi_bhargavan_blanchet_intf.record_keypair -> t Dirsp_exchange_kbb2017__.Kobeissi_bhargavan_blanchet_intf.record_them -> t Dirsp_exchange_kbb2017__.Kobeissi_bhargavan_blanchet_intf.record_msg -> t Dirsp_exchange_kbb2017__.Kobeissi_bhargavan_blanchet_intf.record_recvoutput
recv myIdentityKey mySignedPreKey them msg
receives an encrypted messagemsg
that was ostensibly obtained fromthem
and verifies that it was sent to the session both established with a pre-key signed withmySignedPreKey
and authenticated withmyIdentityKey
.- returns
a
Dirsp_exchange_kbb2017__.Kobeissi_bhargavan_blanchet_intf.record_recvoutput
that, if and only ifreturn_value.output.valid
is true, will have valid plaintext