diff --git a/esphome/core/helpers.cpp b/esphome/core/helpers.cpp index be400bfef2..f01c97e359 100644 --- a/esphome/core/helpers.cpp +++ b/esphome/core/helpers.cpp @@ -158,7 +158,7 @@ uint32_t fnv1_hash(const char *str) { // SplitMix32 PRNG — MurmurHash3 finalizer with golden-ratio increment. // Provides fast, uniform, non-cryptographic random numbers. -// Seeded lazily from the platform's hardware RNG via random_bytes(). +// Seeded lazily from the platform's secure RNG via random_bytes(). // ESP8266 uses os_random() instead (defined in esp8266/helpers.cpp). #ifndef USE_ESP8266 static uint32_t splitmix32_state; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) diff --git a/esphome/core/helpers.h b/esphome/core/helpers.h index 6bf8371f58..43431299de 100644 --- a/esphome/core/helpers.h +++ b/esphome/core/helpers.h @@ -849,7 +849,7 @@ uint32_t random_uint32(); /// Not thread-safe. Must only be called from the main loop. /// Not suitable for cryptographic use; use random_bytes() instead. float random_float(); -/// Generate \p len number of random bytes from the platform's hardware RNG. +/// Generate \p len random bytes using the platform's secure RNG (hardware RNG or OS CSPRNG). /// Thread-safe. Suitable for cryptographic use. bool random_bytes(uint8_t *data, size_t len);