Messages in this thread | | | Date | Sat, 15 Dec 2007 10:30:10 -0600 | From | Matt Mackall <> | Subject | Re: /dev/urandom uses uninit bytes, leaks user data |
| |
On Sat, Dec 15, 2007 at 03:13:19PM +0800, Herbert Xu wrote: > John Reiser <jreiser@bitwagon.com> wrote: > > > > If speed matters that much, then please recoup 33 cycles on x86 > > by using shifts instead of three divides, such as (gcc 4.1.2): > > > > add_entropy_words(r, tmp, (bytes + 3) / 4); > > > > 0x8140689 <xfer_secondary_pool+206>: lea 0x3(%esi),%eax > > 0x814068c <xfer_secondary_pool+209>: mov $0x4,%dl > > 0x814068e <xfer_secondary_pool+211>: mov %edx,%edi > > 0x8140690 <xfer_secondary_pool+213>: cltd > > 0x8140691 <xfer_secondary_pool+214>: idiv %edi > > There ought to be a warning about this sort of thing.
Indeed. Seems it would be better to adjust the types appropriately. Anyway, this is no longer relevant to security@.
-- Mathematics is the supreme nostalgia of our time.
| |