From 7acc46b2caa6b4b8d6c831c4a3d6665c692603b3 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 7 Aug 2026 09:53:39 -0400 Subject: [PATCH] cxd56: make os.urandom() raise NotImplementedError --- ports/cxd56/common-hal/os/__init__.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/ports/cxd56/common-hal/os/__init__.c b/ports/cxd56/common-hal/os/__init__.c index e1024108b07..902228f1db0 100644 --- a/ports/cxd56/common-hal/os/__init__.c +++ b/ports/cxd56/common-hal/os/__init__.c @@ -10,17 +10,7 @@ #include "py/objstr.h" #include "py/objtuple.h" +// No HW TRNG. bool common_hal_os_urandom(uint8_t *buffer, mp_uint_t length) { - uint32_t i = 0; - - while (i < length) { - uint32_t new_random = rand(); - for (int j = 0; j < 4 && i < length; j++) { - buffer[i] = new_random & 0xff; - i++; - new_random >>= 8; - } - } - - return true; + return false; }