15 static int oneshot = 0;
23 for (i = 0; i < 256; i++) {
25 for (j = 0; j < 8; j++) {
27 c = polynomial ^ (c >> 1);
37 crc = table[(crc ^ *data) & 0xff] ^ (crc >> 8);
95 odd[0] = 0xedb88320UL;
143 0xc96c5795d7870f42ULL;
146 static int oneshot = 0;
154 for (i = 0; i < 256; i++) {
156 for (j = 0; j < 8; j++) {
158 c = polynomial ^ (c >> 1);
168 crc = table[(crc ^ *data) & 0xff] ^ (crc >> 8);
226 odd[0] = 0xc96c5795d7870f42ULL;
276 #define DO1(buf,i) {adler += (rpmuint32_t) (buf)[i]; sum2 += adler;}
277 #define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
278 #define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
279 #define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
280 #define DO16(buf) DO8(buf,0); DO8(buf,8);
286 if (a >= (BASE << 16)) a -= (BASE << 16); \
287 if (a >= (BASE << 15)) a -= (BASE << 15); \
288 if (a >= (BASE << 14)) a -= (BASE << 14); \
289 if (a >= (BASE << 13)) a -= (BASE << 13); \
290 if (a >= (BASE << 12)) a -= (BASE << 12); \
291 if (a >= (BASE << 11)) a -= (BASE << 11); \
292 if (a >= (BASE << 10)) a -= (BASE << 10); \
293 if (a >= (BASE << 9)) a -= (BASE << 9); \
294 if (a >= (BASE << 8)) a -= (BASE << 8); \
295 if (a >= (BASE << 7)) a -= (BASE << 7); \
296 if (a >= (BASE << 6)) a -= (BASE << 6); \
297 if (a >= (BASE << 5)) a -= (BASE << 5); \
298 if (a >= (BASE << 4)) a -= (BASE << 4); \
299 if (a >= (BASE << 3)) a -= (BASE << 3); \
300 if (a >= (BASE << 2)) a -= (BASE << 2); \
301 if (a >= (BASE << 1)) a -= (BASE << 1); \
302 if (a >= BASE) a -= BASE; \
306 if (a >= (BASE << 4)) a -= (BASE << 4); \
307 if (a >= (BASE << 3)) a -= (BASE << 3); \
308 if (a >= (BASE << 2)) a -= (BASE << 2); \
309 if (a >= (BASE << 1)) a -= (BASE << 1); \
310 if (a >= BASE) a -= BASE; \
313 # define MOD(a) a %= BASE
314 # define MOD4(a) a %= BASE
323 sum2 = (adler >> 16) & 0xffff;
334 return adler | (sum2 << 16);
350 return adler | (sum2 << 16);
354 while (len >=
NMAX) {
381 return adler | (sum2 << 16);
392 rem = (unsigned)(len2 %
BASE);
393 sum1 = adler1 & 0xffff;
396 sum1 += (adler2 & 0xffff) + BASE - 1;
397 sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
398 if (sum1 > BASE) sum1 -=
BASE;
399 if (sum1 > BASE) sum1 -=
BASE;
400 if (sum2 > (BASE << 1)) sum2 -= (BASE << 1);
401 if (sum2 > BASE) sum2 -=
BASE;
402 return sum1 | (sum2 << 16);