PeerNet.Channel.CipherState (PeerNet v0.1.0)

Copy Markdown View Source

Per-direction AEAD key + counter. Treat as opaque; mutate only via PeerNet.Channel.encrypt/2 and PeerNet.Channel.decrypt/2 (which return updated structs).

Summary

Types

t()

Half of a Channel — one key, one nonce counter.

Functions

Build a fresh CipherState from a 32-byte key.

Types

t()

@type t() :: %PeerNet.Channel.CipherState{counter: non_neg_integer(), key: binary()}

Half of a Channel — one key, one nonce counter.

Functions

new(key)

@spec new(binary()) :: t()

Build a fresh CipherState from a 32-byte key.