看板FB_security
标 题Re: Collecting entropy from device_attach() times.
发信站NCTU CS FreeBSD Server (Wed Oct 3 21:42:03 2012)
转信站ptt!csnews.cs.nctu!news.cs.nctu!FreeBSD.cs.nctu!freebsd.org!owner-free
RW <
[email protected]> writes:
> As I pointed-out before if you use binuptime() you cant use entropy
> estimation based on bit-shifting time differences.
Forgot to answer this: yes you can. The last time I raised the issue, I
also provided sample code for reimplementing get_cyclecount() in terms
of binuptime(). Basically, you discard the top N bits of the integer
portion and the bottom 64 - N bits of the fractional portion, and you're
left with a monotonically increasing 64-bit value that will wrap around
at a point that depends on N.
BTW, get_cyclecount() is documented to work the way I suggest that it
should, not the way it actually does. Also, the man page is incomplete.
For instance, it suggests, but does not state outright, that the value
may wrap around. It also states categorically that TSCs are per-CPU in
SMP systems, whereas in fact all modern amd64 systems (and many P4-era
systems, contingent on motherboard support) have synchronized TSCs.
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]"