esphome-api-client 0.5.0
Modern C++17 client for the ESPHome native API (plaintext + Noise)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
esphome::api::noise::SymmetricState Class Reference

Implements the Noise SymmetricState object: it accumulates the handshake transcript hash h, derives keys through the chaining key ck, and owns the handshake CipherState. More...

#include <symmetric_state.hpp>

Public Member Functions

void initialize (const std::string &protocol_name)
 Initialize from the protocol name (e.g. "Noise_NNpsk0_25519_ChaChaPoly_SHA256").
 
void mix_key (ByteView input)
 MixKey(input): re-derive ck and the CipherState key.
 
void mix_hash (ByteView data)
 MixHash(data): fold data into the transcript hash.
 
void mix_key_and_hash (ByteView input)
 MixKeyAndHash(input): the psk-mixing variant (HKDF with 3 outputs).
 
ByteBuffer encrypt_and_hash (ByteView plaintext)
 EncryptAndHash(plaintext): encrypt (if keyed), fold ciphertext into h.
 
ByteBuffer decrypt_and_hash (ByteView ciphertext)
 DecryptAndHash(ciphertext): decrypt (if keyed), fold ciphertext into h.
 
void split (CipherState &first, CipherState &second) const
 Split(): derive the two transport CipherStates (initiator: first=send).
 
const Hashhandshake_hash () const noexcept
 

Detailed Description

Implements the Noise SymmetricState object: it accumulates the handshake transcript hash h, derives keys through the chaining key ck, and owns the handshake CipherState.

Member Function Documentation

◆ decrypt_and_hash()

ByteBuffer esphome::api::noise::SymmetricState::decrypt_and_hash ( ByteView  ciphertext)

DecryptAndHash(ciphertext): decrypt (if keyed), fold ciphertext into h.

Throws EncryptionError on authentication failure.

◆ encrypt_and_hash()

ByteBuffer esphome::api::noise::SymmetricState::encrypt_and_hash ( ByteView  plaintext)

EncryptAndHash(plaintext): encrypt (if keyed), fold ciphertext into h.

◆ handshake_hash()

const Hash & esphome::api::noise::SymmetricState::handshake_hash ( ) const
inlinenoexcept

◆ initialize()

void esphome::api::noise::SymmetricState::initialize ( const std::string &  protocol_name)

Initialize from the protocol name (e.g. "Noise_NNpsk0_25519_ChaChaPoly_SHA256").

◆ mix_hash()

void esphome::api::noise::SymmetricState::mix_hash ( ByteView  data)

MixHash(data): fold data into the transcript hash.

◆ mix_key()

void esphome::api::noise::SymmetricState::mix_key ( ByteView  input)

MixKey(input): re-derive ck and the CipherState key.

◆ mix_key_and_hash()

void esphome::api::noise::SymmetricState::mix_key_and_hash ( ByteView  input)

MixKeyAndHash(input): the psk-mixing variant (HKDF with 3 outputs).

◆ split()

void esphome::api::noise::SymmetricState::split ( CipherState first,
CipherState second 
) const

Split(): derive the two transport CipherStates (initiator: first=send).


The documentation for this class was generated from the following file: