Thread (21 messages) 21 messages, 7 authors, 2022-10-17

RE: [PATCH v6 3/7] treewide: use get_random_{u8,u16}() when possible, part 1

From: Elliott, Robert (Servers) <hidden>
Date: 2022-10-11 01:19:17
Also in: dri-devel, kernel-janitors, linux-block, linux-crypto, linux-doc, linux-fsdevel, linux-media, linux-mips, linux-mm, linux-mmc, linux-nvme, linux-patches, linux-rdma, linux-s390, linux-um, linux-usb, linux-wireless, linuxppc-dev, lkml, loongarch, sparclinux

quoted hunk ↗ jump to hunk
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
...
quoted hunk ↗ jump to hunk
@@ -944,7 +944,7 @@ static void generate_random_bytes(u8 *buf, size_t count)
 	default:
 		/* Fully random bytes */
 		for (i = 0; i < count; i++)
-			buf[i] = (u8)prandom_u32();
+			buf[i] = get_random_u8();
Should that whole for loop be replaced with this?
    get_random_bytes(buf, count);

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help