Messages in this thread | | | Date | Sun, 16 Jan 2022 14:24:39 +0100 | From | Dominik Brodowski <> | Subject | Re: [PATCH 1/7] random: cleanup poolinfo abstraction |
| |
Am Thu, Jan 13, 2022 at 04:44:07PM +0100 schrieb Jason A. Donenfeld: > Now that we're only using one polynomial, we can cleanup its > representation into constants, instead of passing around pointers > dynamically to select different polynomials. This improves the codegen > and makes the code a bit more straightforward. > > Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> -} poolinfo_table[] = { > - /* was: x^128 + x^103 + x^76 + x^51 +x^25 + x + 1 */ > +enum poolinfo { > + POOL_WORDS = 128, > + POOL_WORDMASK = POOL_WORDS - 1, > + POOL_BYTES = POOL_WORDS * sizeof(u32), > + POOL_BITS = POOL_BYTES * 8, > + POOL_BITSHIFT = ilog2(POOL_WORDS) + 5, > + POOL_FRACBITS = POOL_WORDS << (ENTROPY_SHIFT + 5), > + > /* x^128 + x^104 + x^76 + x^51 +x^25 + x + 1 */ > - { S(128), 104, 76, 51, 25, 1 }, > + POOL_TAP1 = 104, > + POOL_TAP2 = 76,
The only information lost seems to be that POOL_TAP1 used to be 103. But that comment is still available in git history, so feel free to add:
Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net>
Thanks, Dominik
| |