Fix the native_posix fake entropy driver for more than 3 byte requests, and specially for native_sim//64 builds. The host random() provides a number between 0 and 2**31-1 (INT_MAX), so bit 32 was always 0. So when filling a buffer with more than 3 bytes we would be filling each 4th byte with a byte which always had its MSbit as 0. For LP64 native_sim//64 builds, this was even worse, as the driver had another bug where we assumed random() returned the whole long filled, and therefore all 4 upper bytes would be 0. Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no> |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| entropy_b91_trng.c | ||
| entropy_bt_hci.c | ||
| entropy_cc13xx_cc26xx.c | ||
| entropy_esp32.c | ||
| entropy_gecko_se.c | ||
| entropy_gecko_trng.c | ||
| entropy_handlers.c | ||
| entropy_litex.c | ||
| entropy_max32.c | ||
| entropy_mcux_caam.c | ||
| entropy_mcux_rng.c | ||
| entropy_mcux_rnga.c | ||
| entropy_mcux_trng.c | ||
| entropy_neorv32_trng.c | ||
| entropy_npcx_drbg.c | ||
| entropy_nrf5.c | ||
| entropy_psa_crypto.c | ||
| entropy_renesas_ra.c | ||
| entropy_rv32m1_trng.c | ||
| entropy_sam.c | ||
| entropy_smartbond.c | ||
| entropy_stm32.c | ||
| fake_entropy_native_bottom.c | ||
| fake_entropy_native_bottom.h | ||
| fake_entropy_native_posix.c | ||
| Kconfig | ||
| Kconfig.b91 | ||
| Kconfig.bt_hci | ||
| Kconfig.cc13xx_cc26xx | ||
| Kconfig.esp32 | ||
| Kconfig.gecko | ||
| Kconfig.litex | ||
| Kconfig.max32 | ||
| Kconfig.mcux | ||
| Kconfig.native_posix | ||
| Kconfig.neorv32 | ||
| Kconfig.npcx | ||
| Kconfig.nrf5 | ||
| Kconfig.psa_crypto | ||
| Kconfig.renesas_ra | ||
| Kconfig.rv32m1 | ||
| Kconfig.sam | ||
| Kconfig.smartbond | ||
| Kconfig.stm32 | ||