Re: Collecting entropy from device_attach() times.

看板FB_security作者時間13年前 (2012/09/28 06:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串68/80 (看更多)
Bruce Evans <brde@optusnet.com.au> writes: > "Dag-Erling Sm=C3=B8rgrav" <des@des.no> writes: > > RW <rwmaillists@googlemail.com> 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 - des@des.no _______________________________________________ freebsd-security@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-security To unsubscribe, send any mail to "freebsd-security-unsubscribe@freebsd.org"
文章代碼(AID): #1GPDFYXS (FB_security)
討論串 (同標題文章)
文章代碼(AID): #1GPDFYXS (FB_security)