X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Frandom32.c;h=1f44bdc6e8d34a2f55a5c57694c7e8d9ac124f6e;hb=5a5521966e7d7f9773a9f1d867975113837e1335;hp=fc3545a32771569dda97e8169d79151af8add933;hpb=c029b55af7d6b02b993e8a5add78d062da7a3940;p=pandora-kernel.git diff --git a/lib/random32.c b/lib/random32.c index fc3545a32771..1f44bdc6e8d3 100644 --- a/lib/random32.c +++ b/lib/random32.c @@ -92,7 +92,7 @@ void srandom32(u32 entropy) */ for_each_possible_cpu (i) { struct rnd_state *state = &per_cpu(net_rand_state, i); - state->s1 = __seed(state->s1 ^ entropy, 1); + state->s1 = __seed(state->s1 ^ entropy, 2); } } EXPORT_SYMBOL(srandom32); @@ -109,9 +109,9 @@ static int __init random32_init(void) struct rnd_state *state = &per_cpu(net_rand_state,i); #define LCG(x) ((x) * 69069) /* super-duper LCG */ - state->s1 = __seed(LCG(i + jiffies), 1); - state->s2 = __seed(LCG(state->s1), 7); - state->s3 = __seed(LCG(state->s2), 15); + state->s1 = __seed(LCG(i + jiffies), 2); + state->s2 = __seed(LCG(state->s1), 8); + state->s3 = __seed(LCG(state->s2), 16); /* "warm it up" */ prandom32(state); @@ -138,9 +138,9 @@ static int __init random32_reseed(void) u32 seeds[3]; get_random_bytes(&seeds, sizeof(seeds)); - state->s1 = __seed(seeds[0], 1); - state->s2 = __seed(seeds[1], 7); - state->s3 = __seed(seeds[2], 15); + state->s1 = __seed(seeds[0], 2); + state->s2 = __seed(seeds[1], 8); + state->s3 = __seed(seeds[2], 16); /* mix it in */ prandom32(state);