svn commit: r285439 - head/sys/dev/random

Peter Jeremy peter at rulingia.com
Mon Jul 13 19:26:03 UTC 2015


On 2015-Jul-13 08:38:21 +0000, Mark Murray <markm at FreeBSD.org> wrote:
>+			/*
>+			 * Belt-and-braces.
>+			 * Round up the read length to a crypto block size multiple,
>+			 * which is what the underlying generator is expecting.
>+			 * See the random_buf size requirements in the Yarrow/Fortuna code.
>+			 */
>+			read_len += RANDOM_BLOCKSIZE;
>+			read_len -= read_len % RANDOM_BLOCKSIZE;

Note that if read_len was already a multiple of RANDOM_BLOCKSIZE, this will
pad it by an additional RANDOM_BLOCKSIZE.  I don't think this matters but
it's not what the comment implies.  (The comment also goes over 80 columns).

-- 
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 949 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20150714/0bb524d4/attachment.bin>


More information about the svn-src-all mailing list