Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Oct 2018 20:12:58 +0000 (UTC)
From:      Conrad Meyer <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r339480 - head/sys/dev/random
Message-ID:  <201810202012.w9KKCwOc097426@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cem
Date: Sat Oct 20 20:12:57 2018
New Revision: 339480
URL: https://svnweb.freebsd.org/changeset/base/339480

Log:
  Fortuna: Add trivial assert to match FS&K definition
  
  FS&K GenerateBlocks function asserts C (counter) != 0.  This should also
  be true in our implementation.
  
  Reviewed by:	delphij, markm
  Approved by:	secteam (delphij)
  Sponsored by:	Dell EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D16936

Modified:
  head/sys/dev/random/fortuna.c

Modified: head/sys/dev/random/fortuna.c
==============================================================================
--- head/sys/dev/random/fortuna.c	Sat Oct 20 19:44:59 2018	(r339479)
+++ head/sys/dev/random/fortuna.c	Sat Oct 20 20:12:57 2018	(r339480)
@@ -310,6 +310,8 @@ random_fortuna_genblocks(uint8_t *buf, u_int blockcoun
 	u_int i;
 
 	RANDOM_RESEED_ASSERT_LOCK_OWNED();
+	KASSERT(!uint128_is_zero(fortuna_state.fs_counter), ("FS&K: C != 0"));
+
 	for (i = 0; i < blockcount; i++) {
 		/*-
 		 * FS&K - r = r|E(K,C)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810202012.w9KKCwOc097426>