Implements the Noise_XX handshake primitives used by WhatsApp Web.
The state mirrors the Go implementation bundled with whatsmeow. It keeps track of the running hash, the current AEAD key and the handshake counters.
Summary
Functions
Mixes additional authenticated data into the running handshake hash.
Decrypts a handshake payload and updates hash/counter on success.
Derives transport write/read keys from the current handshake salt.
Encrypts a handshake payload using the current key and updates hash/counter.
Derives a new handshake key/salt pair from input key material.
Mixes a Curve25519 shared secret into the handshake key schedule.
Initializes a Noise handshake state with the provided protocol pattern and header.
Types
@type t() :: %ExWapp.Noise.Handshake{ counter: non_neg_integer(), hash: binary(), key: binary(), salt: binary() }
Functions
Mixes additional authenticated data into the running handshake hash.
Decrypts a handshake payload and updates hash/counter on success.
Derives transport write/read keys from the current handshake salt.
Encrypts a handshake payload using the current key and updates hash/counter.
Derives a new handshake key/salt pair from input key material.
Initializes a Noise handshake state with the provided protocol pattern and header.