ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
esphome::noise Namespace Reference

Data Structures

class  NoiseContext
 
class  NoiseResponderHandshake
 Sans-IO responder side of a Noise_NNpsk0_25519_ChaChaPoly_SHA256 handshake. More...
 

Typedefs

using psk_t = std::array<uint8_t, 32>
 

Functions

 ESPHOME_LOG_TAG (TAG, "noise")
 
void prepare_spare_ephemeral ()
 Fill the slot; blocks for the base point multiply.
 
int consume_spare_ephemeral (NoiseHandshakeState *state)
 Move the key pair into a handshake that has not started and wipe the slot; 0 unless noise-c rejects it.
 
const LogString * noise_err_to_logstr (int err)
 Convert a noise error code to a readable error.
 
const LogString * reject_reason_for (int err)
 Reject reason for a failed handshake read.
 
size_t format_reject_payload (uint8_t *buf, size_t capacity, const LogString *reason)
 Fill buf with a handshake reject payload (status byte plus the reason text, PROGMEM aware); returns the payload length.
 
bool has_spare_ephemeral ()
 
void write_frame_header (uint8_t *buf, uint16_t payload_len)
 
void noise_rand_bytes (void *output, size_t len)
 

Variables

uint8_t spare_ephemeral [SPARE_EPHEMERAL_SIZE]
 

Typedef Documentation

◆ psk_t

using esphome::noise::psk_t = std::array<uint8_t, 32>

Definition at line 14 of file noise.h.

Function Documentation

◆ consume_spare_ephemeral()

int esphome::noise::consume_spare_ephemeral ( NoiseHandshakeState * state)

Move the key pair into a handshake that has not started and wipe the slot; 0 unless noise-c rejects it.

Definition at line 46 of file noise.cpp.

◆ ESPHOME_LOG_TAG()

esphome::noise::ESPHOME_LOG_TAG ( TAG ,
"noise"  )

◆ format_reject_payload()

size_t esphome::noise::format_reject_payload ( uint8_t * buf,
size_t capacity,
const LogString * reason )

Fill buf with a handshake reject payload (status byte plus the reason text, PROGMEM aware); returns the payload length.

buf needs capacity for the status byte plus the truncated reason.

Definition at line 100 of file noise.cpp.

◆ has_spare_ephemeral()

bool esphome::noise::has_spare_ephemeral ( )
inline

Definition at line 52 of file noise.h.

◆ noise_err_to_logstr()

const LogString * esphome::noise::noise_err_to_logstr ( int err)

Convert a noise error code to a readable error.

Definition at line 58 of file noise.cpp.

◆ noise_rand_bytes()

void esphome::noise::noise_rand_bytes ( void * output,
size_t len )

Definition at line 146 of file noise_handshake.cpp.

◆ prepare_spare_ephemeral()

void esphome::noise::prepare_spare_ephemeral ( )

Fill the slot; blocks for the base point multiply.

Definition at line 31 of file noise.cpp.

◆ reject_reason_for()

const LogString * esphome::noise::reject_reason_for ( int err)

Reject reason for a failed handshake read.

The MAC failure string is a wire contract: clients match it to report a wrong key.

Definition at line 96 of file noise.cpp.

◆ write_frame_header()

void esphome::noise::write_frame_header ( uint8_t * buf,
uint16_t payload_len )
inline

Definition at line 70 of file noise.h.

Variable Documentation

◆ spare_ephemeral

uint8_t esphome::noise::spare_ephemeral

Definition at line 29 of file noise.cpp.