• Willy Tarreau's avatar
    random32: add a selftest for the prandom32 code · c6e169bc
    Willy Tarreau authored
    Given that this code is new, let's add a selftest for it as well.
    It doesn't rely on fixed sets, instead it picks 1024 numbers and
    verifies that they're not more correlated than desired.
    
    Link: https://lore.kernel.org/netdev/20200808152628.GA27941@SDF.ORG/
    Cc: George Spelvin <lkml@sdf.org>
    Cc: Amit Klein <aksecurity@gmail.com>
    Cc: Eric Dumazet <edumazet@google.com>
    Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: Kees Cook <keescook@chromium.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: tytso@mit.edu
    Cc: Florian Westphal <fw@strlen.de>
    Cc: Marc Plumb <lkml.mplumb@gmail.com>
    Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
    c6e169bc
random32.c 18.5 KB