Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions ports/cxd56/common-hal/os/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Loading