Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Jun 1996 18:13:04 +0200
From:      Mark Murray <mark@grondar.za>
To:        bde@freebsd.org, sos@freebsd.org
Cc:        current@freebsd.org
Subject:   Syscons mouse as entropy source. Please review...
Message-ID:  <199606231613.SAA01694@grumble.grondar.za>

next in thread | raw e-mail | index | archive | help
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



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