Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 14 Dec 2016 18:58:47 +0100
From: "Jason A. Donenfeld" <>
To:, "Theodore Ts'o" <>, 
	"Jason A. Donenfeld" <>, Netdev <>, 
	David Miller <>, Linus Torvalds <>, 
	LKML <>, George Spelvin <>, 
	Scott Bauer <>, Andi Kleen <>, 
	Andy Lutomirski <>, Greg KH <>, 
	Eric Biggers <>, 
	Linux Crypto Mailing List <>, 
	Jean-Philippe Aumasson <>
Subject: Re: Re: [PATCH 4/3] random: use siphash24 instead
 of md5 for get_random_int/long

Hey Ted,

On Wed, Dec 14, 2016 at 5:37 PM, Theodore Ts'o <> wrote:
> One somewhat undesirable aspect of the current algorithm is that we
> never change random_int_secret.

Why exactly would this be a problem? So long as the secret is kept
secret, the PRF is secure. If an attacker can read arbitrary kernel
memory, there are much much bigger issues to be concerned about. As
well, the "chaining" variable I introduce ensures that the random
numbers are, per-cpu, related to the uniqueness of timing of
subsequent calls.

> So I've been toying with the
> following, which is 4 times faster than md5.  (I haven't tried
> benchmarking against siphash yet.)
> [    3.606139] random benchmark!!
> [    3.606276] get_random_int # cycles: 326578
> [    3.606317] get_random_int_new # cycles: 95438
> [    3.607423] get_random_bytes # cycles: 2653388

Cool, I'll benchmark it against the siphash implementation. I like
what you did with batching up lots of chacha output, and doling it out
bit by bit. I suspect this will be quite fast, because with chacha20
you get an entire block.

> P.S.  It's interesting to note that siphash24 and chacha20 are both
> add-rotate-xor based algorithms.

Quite! Lots of nice shiny things are turning out be be ARX -- ChaCha,
BLAKE2, Siphash, NORX. The simplicity is really appealing.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.