lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 29 Dec 2014 21:41:49 +1100
From:	Herbert Xu <>
To:	Stephan Mueller <>
Cc:	Daniel Borkmann <>,
	'Quentin Gouchet' <>,
	'LKML' <>,,
Subject: Re: [PATCH v6 3/4] crypto: AF_ALG: add random number generator

On Thu, Dec 25, 2014 at 11:00:06PM +0100, Stephan Mueller wrote:
> This patch adds the random number generator support for AF_ALG.
> A random number generator's purpose is to generate data without
> requiring the caller to provide any data. Therefore, the AF_ALG
> interface handler for RNGs only implements a callback handler for
> recvmsg.
> The following parameters provided with a recvmsg are processed by the
> RNG callback handler:
> 	* sock - to resolve the RNG context data structure accessing the
> 	  RNG instance private to the socket
> 	* len - this parameter allows userspace callers to specify how
> 	  many random bytes the RNG shall produce and return. As the
> 	  kernel context for the RNG allocates a buffer of 128 bytes to
> 	  store random numbers before copying them to userspace, the len
> 	  parameter is checked that it is not larger than 128. If a
> 	  caller wants more random numbers, a new request for recvmsg
> 	  shall be made.
> The size of 128 bytes is chose because of the following considerations:
> 	* to increase the memory footprint of the kernel too much (note,
> 	  that would be 128 bytes per open socket)
> 	* 128 is divisible by any typical cryptographic block size an
> 	  RNG may have
> 	* A request for random numbers typically only shall supply small
> 	  amount of data like for keys or IVs that should only require
> 	  one invocation of the recvmsg function.
> Note, during instantiation of the RNG, the code checks whether the RNG
> implementation requires seeding. If so, the RNG is seeded with output
> from get_random_bytes.
> A fully working example using all aspects of the RNG interface is
> provided at
> Signed-off-by: Stephan Mueller <>

Patch applied.
Email: Herbert Xu <>
Home Page:
PGP Key:
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists