Skip to content

Commit cde30c2

Browse files
committed
Merge branch 'fix/rng_entropy_mixing_with_rtc_timer' into 'master'
fix(esp_hw_support): Fixed entropy mixing of RTC timer with RNG See merge request espressif/esp-idf!41723
2 parents e3190c6 + 0cd73df commit cde30c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/esp_hw_support/hw_random.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ uint32_t IRAM_ATTR esp_random(void)
7878
result ^= REG_READ(WDEV_RND_REG);
7979
} while (ccount - last_ccount < cpu_to_apb_freq_ratio * APB_CYCLE_WAIT_NUM);
8080
uint32_t current_rtc_timer_counter = (lp_timer_hal_get_cycle_count() & 0xFF);
81-
result ^= ((result ^ current_rtc_timer_counter) & 0xFF) << (i * 8);
81+
result ^= (current_rtc_timer_counter << (i * 8));
8282
}
8383
#else
8484
do {

0 commit comments

Comments
 (0)