linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* random(4) question
@ 2022-01-20 10:39 Sandy Harris
  2022-01-20 10:44 ` Jason A. Donenfeld
  2022-01-20 15:34 ` Theodore Ts'o
  0 siblings, 2 replies; 3+ messages in thread
From: Sandy Harris @ 2022-01-20 10:39 UTC (permalink / raw)
  To: Linux Crypto Mailing List, Jason A. Donenfeld, Ted Ts'o,
	Herbert Xu

I see this in the current random.c

/* Note that EXTRACT_SIZE is half of hash size here, because above
 * we've dumped the full length back into mixer. By reducing the
  * amount that we emit, we retain a level of forward secrecy.
  */
   memcpy(out, hash, EXTRACT_SIZE);

Like the previous version based on SHA1, this produces an output half
the hash size which is likely a fine idea since we do not want to
expose the full hash output to an enemy. Unlike the older code,
though, this does expose some hash output.

The older code split the 160-bit hash in half and XORed the halves
together to get an 80-bit output. Should we do that here for 256-bit
output?

Dan Bernstein has something called "SURF: Simple Unpredictable Random
Function." that takes 384 bits in & gives 256 out.
https://cr.yp.to/papers.html#surf
I'm not sure that would work for us since it needs a 1024-bit key and
has 32 rounds, but it seems worth considering.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-20 15:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-20 10:39 random(4) question Sandy Harris
2022-01-20 10:44 ` Jason A. Donenfeld
2022-01-20 15:34 ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).