"Scott G. Miller" wrote:
> It then begins calculating clock jitter, using the low-order three
> bits as random information until the pool is full again.

I suspect this is too much, but who knows?

Here's what the Linux kernel does for /dev/random:

        /*
         * Calculate number of bits of randomness we probably added.
         * We take into account the first, second and third-order deltas
         * in order to make our estimate.
         */
        if ((r->entropy_count < POOLBITS) && !state->dont_count_entropy) {
                delta = time - state->last_time;
                state->last_time = time;

                delta2 = delta - state->last_delta;
                state->last_delta = delta;

                delta3 = delta2 - state->last_delta2;
                state->last_delta2 = delta2;

                if (delta < 0)
                        delta = -delta;
                if (delta2 < 0)
                        delta2 = -delta2;
                if (delta3 < 0)
                        delta3 = -delta3;
                if (delta > delta2)
                        delta = delta2;
                if (delta > delta3)
                        delta = delta3;

                /*
                 * delta is now minimum absolute delta.
                 * Round down by 1 bit on general principles,
                 * and limit entropy entimate to 12 bits.
                 */
                delta >>= 1;
                delta &= (1 << 12) - 1;

                r->entropy_count += int_ln_12bits(delta);

_______________________________________________
Freenet-dev mailing list
Freenet-dev at lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/freenet-dev

Reply via email to