Why is ```(n+1)(BASE-1)``` added when calculating the NMAX of Adler-32?

58 Views Asked by At

zlib/adler32.c code is:

#define BASE 65521U     /* largest prime smaller than 65536 */
#define NMAX 5552
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */

but I think it should be calculated like this:

255n(n+1)/2 + n < 2^32 - 1

What is the purpose of adding (n+1)(BASE-1)?

0

There are 0 best solutions below