From owner-freebsd-current Sun Jun 23 09:14:18 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id JAA05709 for current-outgoing; Sun, 23 Jun 1996 09:14:18 -0700 (PDT) Received: from grumble.grondar.za (grumble.grondar.za [196.7.18.130]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id JAA05678; Sun, 23 Jun 1996 09:13:48 -0700 (PDT) Received: from grumble.grondar.za (mark@localhost.grondar.za [127.0.0.1]) by grumble.grondar.za (8.7.5/8.7.3) with ESMTP id SAA01694; Sun, 23 Jun 1996 18:13:05 +0200 (SAT) Message-Id: <199606231613.SAA01694@grumble.grondar.za> To: bde@freebsd.org, sos@freebsd.org cc: current@freebsd.org Subject: Syscons mouse as entropy source. Please review... Date: Sun, 23 Jun 1996 18:13:04 +0200 From: Mark Murray Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hi SYSCONS's new mouse driver is a _Great_ source of entropy. Please comment on/review these diffs. I am mostly concerned with the placement of the add_mouse_randomness() call, as I do not want to slow down the mouse cursor more than is necessary... Index: i386/include/random.h =================================================================== RCS file: /home/ncvs/src/sys/i386/include/random.h,v retrieving revision 1.6 diff -u -r1.6 random.h --- random.h 1996/06/17 16:47:39 1.6 +++ random.h 1996/06/23 16:00:15 @@ -74,6 +74,7 @@ void rand_initialize(void); void add_keyboard_randomness(u_char scancode); +void add_mouse_randomness(short xpos, short ypos); void add_interrupt_randomness(int irq); #ifdef notused void add_blkdev_randomness(int major); Index: i386/isa/random_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/isa/random_machdep.c,v retrieving revision 1.9 diff -u -r1.9 random_machdep.c --- random_machdep.c 1996/06/17 16:47:43 1.9 +++ random_machdep.c 1996/06/23 16:02:19 @@ -234,6 +234,12 @@ } void +add_mouse_randomness(short xpos, short ypos) +{ + add_timer_randomness(&random_state, &keyboard_timer_state, xpos ^ ypos); +} + +void add_interrupt_randomness(int irq) { (sec_intr_handler[irq])(sec_intr_unit[irq]); Index: i386/isa/syscons.c =================================================================== RCS file: /home/ncvs/src/sys/i386/isa/syscons.c,v retrieving revision 1.153 diff -u -r1.153 syscons.c --- syscons.c 1996/06/21 11:31:09 1.153 +++ syscons.c 1996/06/23 15:57:02 @@ -809,6 +809,7 @@ mark_all(mscp); splx(s); } + add_mouse_randomness(mscp->mouse_xpos, mscp->mouse_ypos); break; case MOUSE_GETPOS: -- Mark Murray 46 Harvey Rd, Claremont, Cape Town 7700, South Africa +27 21 61-3768 GMT+0200 Finger mark@grondar.za for PGP key