Subject: Re: kernel ip_randomid() and libc randomid(3) still "broken"
To: Jonathan Stone <jonathan@DSG.Stanford.EDU>
From: Charles M. Hannum <abuse@spamalicious.com>
List: tech-net
Date: 11/28/2003 06:58:28
BTW, I also analyzed why "seed2" failed the way it did.

The important thing to note is that, when using a prime modulus, the modular 
exponentiation has a cycle of modulus-1 (i.e. RU_N-1).  That is to say, the 
exponent RU_N-1 generates the same output as the exponent 0, RU_N the same as 
1, etc.  The xor was causing aliasing.

Replacing the xor with an addition fixes this problem, but I'm not sure 
whether it has the desired behavior in other regards.