22 for (i = 0; i < 256; i++) {
24 for (j = 0; j < 8; j++) {
26 c = polynomial ^ (c >> 1);
34 crc = table[(crc ^ *data) & 0xff] ^ (crc >> 8);
92 odd[0] = 0xedb88320UL;
140 0xc96c5795d7870f42ULL;
150 for (i = 0; i < 256; i++) {
152 for (j = 0; j < 8; j++) {
154 c = polynomial ^ (c >> 1);
162 crc = table[(crc ^ *data) & 0xff] ^ (crc >> 8);
220 odd[0] = 0xc96c5795d7870f42ULL;
270 #define DO1(buf,i) {adler += (rpmuint32_t) (buf)[i]; sum2 += adler;}
271 #define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
272 #define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
273 #define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
274 #define DO16(buf) DO8(buf,0); DO8(buf,8);
280 if (a >= (BASE << 16)) a -= (BASE << 16); \
281 if (a >= (BASE << 15)) a -= (BASE << 15); \
282 if (a >= (BASE << 14)) a -= (BASE << 14); \
283 if (a >= (BASE << 13)) a -= (BASE << 13); \
284 if (a >= (BASE << 12)) a -= (BASE << 12); \
285 if (a >= (BASE << 11)) a -= (BASE << 11); \
286 if (a >= (BASE << 10)) a -= (BASE << 10); \
287 if (a >= (BASE << 9)) a -= (BASE << 9); \
288 if (a >= (BASE << 8)) a -= (BASE << 8); \
289 if (a >= (BASE << 7)) a -= (BASE << 7); \
290 if (a >= (BASE << 6)) a -= (BASE << 6); \
291 if (a >= (BASE << 5)) a -= (BASE << 5); \
292 if (a >= (BASE << 4)) a -= (BASE << 4); \
293 if (a >= (BASE << 3)) a -= (BASE << 3); \
294 if (a >= (BASE << 2)) a -= (BASE << 2); \
295 if (a >= (BASE << 1)) a -= (BASE << 1); \
296 if (a >= BASE) a -= BASE; \
300 if (a >= (BASE << 4)) a -= (BASE << 4); \
301 if (a >= (BASE << 3)) a -= (BASE << 3); \
302 if (a >= (BASE << 2)) a -= (BASE << 2); \
303 if (a >= (BASE << 1)) a -= (BASE << 1); \
304 if (a >= BASE) a -= BASE; \
307 # define MOD(a) a %= BASE
308 # define MOD4(a) a %= BASE
317 sum2 = (adler >> 16) & 0xffff;
328 return adler | (sum2 << 16);
344 return adler | (sum2 << 16);
348 while (len >=
NMAX) {
375 return adler | (sum2 << 16);
386 rem = (unsigned)(len2 %
BASE);
387 sum1 = adler1 & 0xffff;
390 sum1 += (adler2 & 0xffff) + BASE - 1;
391 sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
392 if (sum1 > BASE) sum1 -=
BASE;
393 if (sum1 > BASE) sum1 -=
BASE;
394 if (sum2 > (BASE << 1)) sum2 -= (BASE << 1);
395 if (sum2 > BASE) sum2 -=
BASE;
396 return sum1 | (sum2 << 16);