[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 12 Dec 2022 10:35:53 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: david.keisarschm@...l.huji.ac.il
Cc: Dave Hansen <dave.hansen@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
x86@...nel.org, "H. Peter Anvin" <hpa@...or.com>,
linux-kernel@...r.kernel.org, intel-gfx@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org, linux-mtd@...ts.infradead.org,
linux-scsi@...r.kernel.org, bpf@...r.kernel.org,
netdev@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH 1/5] Renaming weak prng invocations -
prandom_bytes_state, prandom_u32_state
On Mon, Dec 12, 2022 at 12:16:04AM +0200, david.keisarschm@...l.huji.ac.il wrote:
> From: David <david.keisarschm@...l.huji.ac.il>
>
> 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
Powered by blists - more mailing lists