Thread (9 messages) 9 messages, 6 authors, 2022-12-14

Re: [PATCH 1/5] Renaming weak prng invocations - prandom_bytes_state, prandom_u32_state

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: 2022-12-12 08:36:16
Also in: bpf, dri-devel, intel-gfx, linux-mm, linux-scsi, lkml

On Mon, Dec 12, 2022 at 12:16:04AM +0200, david.keisarschm@mail.huji.ac.il wrote:
From: David <redacted>

Since the two functions
 prandom_byte_state and prandom_u32_state
 use the weak prng prandom_u32,
 we added the prefix predictable_rng,
 to their signatures so it is clear they are weak.
It's fancy indentation.

...
 		/* Fisher-Yates shuffle */
 		for (i = count - 1; i > 0; i--) {
-			rand = prandom_u32_state(&state.rnd_state);
+			rand = predictable_rng_prandom_u32_state(&state.rnd_state);
Isn't it too many "random":s encoded in the name?

I would leave either "rng" or "[p]random".
 			rand %= (i + 1);
 			swap_free_obj(slab, i, rand);
 		}
-- 
With Best Regards,
Andy Shevchenko

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