Bruce Evans <[email protected]> writes:
> "Dag-Erling Smørgrav" <[email protected]> writes:
> > RW <[email protected]> writes:
> > > binuptime(&bt);
> > > return (bt.frac ^ bt.sec);
> > Why the heck does it xor the integer and fractional parts together?
> Because most of the entropy is in the fractional part,

This is not about entropy, it's about implementing get_cyclecount() on a
platform that doesn't have a TSC.  It's supposed to be monotonic, and
this implementation clearly isn't.  Even when bt.sec is small enough
that it doesn't affect significant digits of bt.frac (which should be
most of the time, unless the resolution of the underlying timecounter
exceeds ~2^32 Hz), get_cyclecount() will go backward every time a new
second ticks over.

DES
-- 
Dag-Erling Smørgrav - [email protected]
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-security
To unsubscribe, send any mail to "[email protected]"

Reply via email to