ex_wire v0.1.1 ExWire.Framing.Secrets

Secrets are used to both encrypt and authenticate incoming and outgoing peer to peer messages.

Link to this section Summary

Functions

After a handshake has been completed (i.e. auth and ack have been exchanged), we’re ready to derive the secrets to be used to encrypt frames. This function performs the required computation

Link to this section Types

Link to this type t()
t() :: %ExWire.Framing.Secrets{decoder_stream: ExthCrypto.Cipher.stream, egress_mac: ExthCrypto.MAC.mac_inst, encoder_stream: ExthCrypto.Cipher.stream, ingress_mac: ExthCrypto.MAC.mac_inst, mac_encoder: ExthCrypto.Cipher.cipher, mac_secret: ExthCrypto.Key.symmetric_key, token: binary}

Link to this section Functions

Link to this function derive_secrets(is_initiator, my_ephemeral_private_key, remote_ephemeral_public_key, remote_nonce, my_nonce, auth_data, ack_data)
derive_secrets(boolean, ExthCrypto.Key.private_key, ExthCrypto.Key.public_key, binary, binary, binary, binary) :: t

After a handshake has been completed (i.e. auth and ack have been exchanged), we’re ready to derive the secrets to be used to encrypt frames. This function performs the required computation.

TODO: Add examples

TODO: Clean up API interface

Link to this function new(egress_mac, ingress_mac, mac_secret, symmetric_key, token)