18 #define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;}
19 #define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
20 #define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
21 #define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
22 #define DO16(buf) DO8(buf,0); DO8(buf,8);
31 unsigned long tmp = a >> 16; \
33 a += (tmp << 4) - tmp; \
38 if (a >= BASE) a -= BASE; \
47 z_off64_t tmp = a >> 32; \
49 a += (tmp << 8) - (tmp << 5) + tmp; \
52 a += (tmp << 4) - tmp; \
55 a += (tmp << 4) - tmp; \
56 if (a >= BASE) a -= BASE; \
59 # define MOD(a) a %= BASE
60 # define MOD28(a) a %= BASE
61 # define MOD63(a) a %= BASE
74 sum2 = (adler >> 16) & 0xffff;
85 return adler | (sum2 << 16);
101 return adler | (sum2 << 16);
105 while (len >=
NMAX) {
132 return adler | (sum2 << 16);
151 rem = (unsigned)len2;
152 sum1 = adler1 & 0xffff;
155 sum1 += (adler2 & 0xffff) +
BASE - 1;
156 sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) +
BASE - rem;
159 if (sum2 >= (
BASE << 1)) sum2 -= (
BASE << 1);
161 return sum1 | (sum2 << 16);