mirror of
https://github.com/esphome/esphome.git
synced 2026-09-01 02:26:01 +00:00
Address review: use 'secure RNG' instead of 'hardware RNG' in comments
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user