看板FB_security
标 题Re: Collecting entropy from device_attach() times.
发信站NCTU CS FreeBSD Server (Fri Sep 28 08:10:15 2012)
转信站ptt!csnews.cs.nctu!news.cs.nctu!FreeBSD.cs.nctu!freebsd.org!owner-free
Bruce Evans <
[email protected]> writes:
> "Dag-Erling Sm=C3=B8rgrav" <[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
--=20
Dag-Erling Sm=C3=B8rgrav -
[email protected]
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-security
To unsubscribe, send any mail to "
[email protected]"