Byte buffer / view aliases and protobuf base-128 varint codec.
Noise CipherState: a keyed AEAD with an incrementing nonce.
Non-owning view over a contiguous run of bytes (a C++17 stand-in for std::span<const std::uint8_t>).
Definition bytes.hpp:17
Wraps a symmetric key plus a monotonically increasing nonce, per the Noise CipherState object.
Definition cipher_state.hpp:15
Implements the Noise SymmetricState object: it accumulates the handshake transcript hash h,...
Definition symmetric_state.hpp:18
ByteBuffer decrypt_and_hash(ByteView ciphertext)
DecryptAndHash(ciphertext): decrypt (if keyed), fold ciphertext into h.
ByteBuffer encrypt_and_hash(ByteView plaintext)
EncryptAndHash(plaintext): encrypt (if keyed), fold ciphertext into h.
void initialize(const std::string &protocol_name)
Initialize from the protocol name (e.g. "Noise_NNpsk0_25519_ChaChaPoly_SHA256").
void split(CipherState &first, CipherState &second) const
Split(): derive the two transport CipherStates (initiator: first=send).
void mix_key_and_hash(ByteView input)
MixKeyAndHash(input): the psk-mixing variant (HKDF with 3 outputs).
void mix_hash(ByteView data)
MixHash(data): fold data into the transcript hash.
const Hash & handshake_hash() const noexcept
Definition symmetric_state.hpp:42
void mix_key(ByteView input)
MixKey(input): re-derive ck and the CipherState key.
Definition cipher_state.hpp:11
constexpr auto protocol_name
Noise protocol name for the ESPHome native API.
Definition noise_handshake.hpp:14
std::array< std::uint8_t, hash_len > Hash
Definition primitives.hpp:20
std::vector< std::uint8_t > ByteBuffer
Owning, growable byte buffer.
Definition bytes.hpp:13
Noise cryptographic primitives (SHA-256, HMAC, HKDF, X25519, ChaCha20- Poly1305, base64).