Re: /dev/random oddness

From: H. Peter Anvin (hpa@transmeta.com)
Date: Wed Feb 02 2000 - 23:08:31 EST


Followup to: <200002012318.XAA01482@raistlin.arm.linux.org.uk>
By author: Russell King <rmk@arm.linux.org.uk>
In newsgroup: linux.dev.kernel
>
> Hi,
>
> I've just had a report that I've confirmed that /dev/random on ARM doesn't
> behave the same as /dev/random on x86.
>
> I've confirmed this by comparing a NetWinder with an IBM thinkpad.
> Both these have PS/2 mice. The NetWinder is running 2.3.41, which
> uses the standard random.c and pc_keyb.c sources. The thinkpad is
> running untouched 2.2.12 at the moment.
>
> On the thinkpad, doing an 'od -t x1 -Ax /dev/random' and moving the
> mouse in a console results in a lot of bytes being generated from
> the device. However, on a NetWinder, it results in very few, less
> than 1/10th of what the x86 machine produces.
>
> I have also compared it with other ARM architectures (on 2.2.14) use
> the busmice code (which got added to 2.3 iirc) to add randomness,
> and that behaves in the same manner as the NetWinder.
>
> Does anyone have any clues what might be causing this odd behaviour?
> I haven't scanned over random.c in any great depth yet.
>

It depends on the resolution of your timer. Higher resolution = more
randomness. On IA32 the time stamp counter register is used to get a
very high resolution timer, which gives you plenty of randomness per
event.

        -hpa

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Feb 07 2000 - 21:00:09 EST