Collecting entropy from device_attach() times.

Dag-Erling Smørgrav des at des.no
Thu Sep 27 14:34:24 UTC 2012


RW <rwmaillists at googlemail.com> writes:
> static __inline uint64_t
> get_cyclecount(void)
> {
>         struct bintime bt;
>
>         binuptime(&bt);
>         return (bt.frac ^ bt.sec);
>                         
> }

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
-- 
Dag-Erling Smørgrav - des at des.no


More information about the freebsd-security mailing list