On Thu, 8 Jun 2000, Mark Murray wrote:

> Hi
> > +   /* Encode the PID (with 1 bit of randomness) into 3 base-64 chars */
> > +   pid = getpid() | (arc4random() & 0x00020000);
> What is the purpose of this? It looks hugely wasteful to me. If you
> really need a single random bit, it is not good to waste a block of
> hard-gained gryptographic randomness; can you not use a pseudo-random
> bit-generator?

arc4random() does not consume entropy except the first time it is called
and when explicitly reseeded through arc4random_stir(). Apart from that
it's a deterministic function (the arc4 stream cipher), but it's still a
reasonably good cryptographic PRNG because arc4 is a cryptographically
strong algorithm.


In God we Trust -- all others must submit an X.509 certificate.
    -- Charles Forsythe <[EMAIL PROTECTED]>

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to