From owner-cvs-all Fri Oct 11 6:13:12 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1B66B37B401; Fri, 11 Oct 2002 06:13:11 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id D1EAD43EAC; Fri, 11 Oct 2002 06:13:10 -0700 (PDT) (envelope-from phk@FreeBSD.org) Received: from freefall.freebsd.org (phk@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g9BDDACo002351; Fri, 11 Oct 2002 06:13:10 -0700 (PDT) (envelope-from phk@freefall.freebsd.org) Received: (from phk@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g9BDDA3E002348; Fri, 11 Oct 2002 06:13:10 -0700 (PDT) Message-Id: <200210111313.g9BDDA3E002348@freefall.freebsd.org> From: Poul-Henning Kamp Date: Fri, 11 Oct 2002 06:13:09 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/libkern arc4random.c src/sys/sys libkern.h src/share/man/man9 random.9 X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG phk 2002/10/11 06:13:09 PDT Modified files: sys/libkern arc4random.c sys/sys libkern.h share/man/man9 random.9 Log: Slight overhaul of arc4random() and friends. One bug fixed: Use getmicrouptime() to trigger reseeds so that we cannot be tricked by a clock being stepped backwards. Express parameters in natural units and with natural names. Don't use struct timeval more than we need to. Various stylistic and readability polishing. Introduce arc4rand(void *ptr, u_int len, int reseed) function which returns a stream of pseudo-random bytes, observing the automatic reseed criteria as well as allowing forced reseeds. Rewrite arc4random() in terms of arc4rand(). Sponsored by: DARPA & NAI Labs. Revision Changes Path 1.7 +24 -6 src/share/man/man9/random.9 1.10 +28 -23 src/sys/libkern/arc4random.c 1.34 +2 -1 src/sys/sys/libkern.h To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message