Fix typo in pico_rand breaking randomness when PICO_RAND_ENTROPY_SRC_BUS_PERF_COUNTER=1 (#1246)

This commit is contained in:
Graham Sanderson 2023-02-12 10:51:08 -06:00 committed by GitHub
parent 79d0eb472d
commit e763cb8e99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -272,7 +272,7 @@ uint64_t get_rand_64(void) {
if (bus_counter_value == BUSCTRL_PERFCTR0_BITS) {
bus_ctrl_hw->counter[bus_counter_idx].value = 0;
}
local_rng_state.r[which] &= splitmix64(bus_counter_value);
local_rng_state.r[which] ^= splitmix64(bus_counter_value);
which ^= 1;
#endif