mirror of
https://github.com/esphome/esphome.git
synced 2026-09-21 12:08:38 +00:00
The responder's ephemeral key pair was generated inside the handshake write step, a base point multiply of about 60 ms on ESP8266 that every connecting client waited for. The noise component now keeps one spare key pair (64 bytes of static storage, only in builds with an encrypted api since the api server is the only refiller), the api server refills it from loop() once the network is up and no api client is mid handshake, and both the api and ota handshakes take it through noise-c's noise_handshakestate_set_local_ephemeral(). A handshake that finds the slot empty, or whose spare noise-c refuses, generates its own key as before. The host gtest suite covers the slot's single use, the key pair's consistency, and a full handshake whose message carries the supplied key.