public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
* RE: Using get_cycles for add_timer_randomness
@ 2004-08-16 18:53 Luck, Tony
  0 siblings, 0 replies; 10+ messages in thread
From: Luck, Tony @ 2004-08-16 18:53 UTC (permalink / raw)
  To: Andrew Morton, Anton Blanchard; +Cc: arnd, richm, tytso, linux-arch


>+		if (sizeof(time) > 4)
>+			num ^= (u32)(time >> 32);

How does this bit-flipping the low-order bits based on the high
order bits of the timer help get more randomness?  It looks to
me that it will just mess up the calculation of how much randomness
you might have added. The delta/delta2/delta3 comparisons that
are done later in the function appear to be based on the idea
that you measure the `time' between events.  High order bits in
cycle counters change at quite predicatable intervals and shouldn't
take part in this calculation.

-Tony

^ permalink raw reply	[flat|nested] 10+ messages in thread
* RE: Using get_cycles for add_timer_randomness
@ 2004-08-16 21:29 Luck, Tony
  0 siblings, 0 replies; 10+ messages in thread
From: Luck, Tony @ 2004-08-16 21:29 UTC (permalink / raw)
  To: Luck, Tony, Andrew Morton, Anton Blanchard; +Cc: arnd, richm, tytso, linux-arch

>>+		if (sizeof(time) > 4)
>>+			num ^= (u32)(time >> 32);
>
>How does this bit-flipping the low-order bits based on the high
>order bits of the timer help get more randomness?  It looks to
>me that it will just mess up the calculation of how much randomness
>you might have added. The delta/delta2/delta3 comparisons that
>are done later in the function appear to be based on the idea
>that you measure the `time' between events.  High order bits in
>cycle counters change at quite predicatable intervals and shouldn't
>take part in this calculation.

So I can't read today ... I was sure that "num" said "time" when
I wrote the above ... so disregard the part about messing up
delta calculations.  But I'm still don't see how using the high
bits of the cycle counter can be a good thing.

-Tony

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-08-19 18:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200308160303.17612.arnd@arndb.de>
     [not found] ` <20040810162435.GK24690@krispykreme>
     [not found]   ` <20040814183623.GB5637@krispykreme>
2004-08-15 22:48     ` Using get_cycles for add_timer_randomness Andrew Morton
2004-08-15 23:46       ` Richard Mortimer
2004-08-15 23:59       ` David S. Miller
2004-08-16 16:17       ` Theodore Ts'o
2004-08-16 16:22         ` William Lee Irwin III
2004-08-16 16:44           ` Ralf Baechle
2004-08-16 16:49             ` William Lee Irwin III
2004-08-19 18:26               ` Ralf Baechle
2004-08-16 18:53 Luck, Tony
  -- strict thread matches above, loose matches on Subject: below --
2004-08-16 21:29 Luck, Tony

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox