看板FB_security
标 题Re: Collecting entropy from device_attach() times.
发信站NCTU CS FreeBSD Server (Fri Sep 28 00:34:23 2012)
转信站ptt!csnews.cs.nctu!news.cs.nctu!FreeBSD.cs.nctu!freebsd.org!owner-free
RW <
[email protected]> writes:
> static __inline uint64_t
> get_cyclecount(void)
> {
> struct bintime bt;
>
> binuptime(&bt);
> return (bt.frac ^ bt.sec);
>=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
> }
Why the heck does it xor the integer and fractional parts together?
That makes no sense at all. I would have used ((uint64_t)bt.sec << 32 |
bt.frac >> 32). It wraps around after 136 years' uptime, but hey, you
can't win them all.
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]"