Blame deps/zlib/crc32.c

Packit Service 20376f
/* crc32.c -- compute the CRC-32 of a data stream
Packit Service 20376f
 * Copyright (C) 1995-2006, 2010, 2011, 2012, 2016 Mark Adler
Packit Service 20376f
 * For conditions of distribution and use, see copyright notice in zlib.h
Packit Service 20376f
 *
Packit Service 20376f
 * Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster
Packit Service 20376f
 * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing
Packit Service 20376f
 * tables for updating the shift register in one step with three exclusive-ors
Packit Service 20376f
 * instead of four steps with four exclusive-ors.  This results in about a
Packit Service 20376f
 * factor of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3.
Packit Service 20376f
 */
Packit Service 20376f
Packit Service 20376f
/* @(#) $Id$ */
Packit Service 20376f
Packit Service 20376f
/*
Packit Service 20376f
  Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore
Packit Service 20376f
  protection on the static variables used to control the first-use generation
Packit Service 20376f
  of the crc tables.  Therefore, if you #define DYNAMIC_CRC_TABLE, you should
Packit Service 20376f
  first call get_crc_table() to initialize the tables before allowing more than
Packit Service 20376f
  one thread to use crc32().
Packit Service 20376f
Packit Service 20376f
  DYNAMIC_CRC_TABLE and MAKECRCH can be #defined to write out crc32.h.
Packit Service 20376f
 */
Packit Service 20376f
Packit Service 20376f
#ifdef MAKECRCH
Packit Service 20376f
#  include <stdio.h>
Packit Service 20376f
#  ifndef DYNAMIC_CRC_TABLE
Packit Service 20376f
#    define DYNAMIC_CRC_TABLE
Packit Service 20376f
#  endif /* !DYNAMIC_CRC_TABLE */
Packit Service 20376f
#endif /* MAKECRCH */
Packit Service 20376f
Packit Service 20376f
#include "zutil.h"      /* for STDC and FAR definitions */
Packit Service 20376f
Packit Service 20376f
/* Definitions for doing the crc four data bytes at a time. */
Packit Service 20376f
#if !defined(NOBYFOUR) && defined(Z_U4)
Packit Service 20376f
#  define BYFOUR
Packit Service 20376f
#endif
Packit Service 20376f
#ifdef BYFOUR
Packit Service 20376f
   local unsigned long crc32_little OF((unsigned long,
Packit Service 20376f
                        const unsigned char FAR *, z_size_t));
Packit Service 20376f
   local unsigned long crc32_big OF((unsigned long,
Packit Service 20376f
                        const unsigned char FAR *, z_size_t));
Packit Service 20376f
#  define TBLS 8
Packit Service 20376f
#else
Packit Service 20376f
#  define TBLS 1
Packit Service 20376f
#endif /* BYFOUR */
Packit Service 20376f
Packit Service 20376f
/* Local functions for crc concatenation */
Packit Service 20376f
local unsigned long gf2_matrix_times OF((unsigned long *mat,
Packit Service 20376f
                                         unsigned long vec));
Packit Service 20376f
local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat));
Packit Service 20376f
local uLong crc32_combine_ OF((uLong crc1, uLong crc2, z_off64_t len2));
Packit Service 20376f
Packit Service 20376f
Packit Service 20376f
#ifdef DYNAMIC_CRC_TABLE
Packit Service 20376f
Packit Service 20376f
local volatile int crc_table_empty = 1;
Packit Service 20376f
local z_crc_t FAR crc_table[TBLS][256];
Packit Service 20376f
local void make_crc_table OF((void));
Packit Service 20376f
#ifdef MAKECRCH
Packit Service 20376f
   local void write_table OF((FILE *, const z_crc_t FAR *));
Packit Service 20376f
#endif /* MAKECRCH */
Packit Service 20376f
/*
Packit Service 20376f
  Generate tables for a byte-wise 32-bit CRC calculation on the polynomial:
Packit Service 20376f
  x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.
Packit Service 20376f
Packit Service 20376f
  Polynomials over GF(2) are represented in binary, one bit per coefficient,
Packit Service 20376f
  with the lowest powers in the most significant bit.  Then adding polynomials
Packit Service 20376f
  is just exclusive-or, and multiplying a polynomial by x is a right shift by
Packit Service 20376f
  one.  If we call the above polynomial p, and represent a byte as the
Packit Service 20376f
  polynomial q, also with the lowest power in the most significant bit (so the
Packit Service 20376f
  byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,
Packit Service 20376f
  where a mod b means the remainder after dividing a by b.
Packit Service 20376f
Packit Service 20376f
  This calculation is done using the shift-register method of multiplying and
Packit Service 20376f
  taking the remainder.  The register is initialized to zero, and for each
Packit Service 20376f
  incoming bit, x^32 is added mod p to the register if the bit is a one (where
Packit Service 20376f
  x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by
Packit Service 20376f
  x (which is shifting right by one and adding x^32 mod p if the bit shifted
Packit Service 20376f
  out is a one).  We start with the highest power (least significant bit) of
Packit Service 20376f
  q and repeat for all eight bits of q.
Packit Service 20376f
Packit Service 20376f
  The first table is simply the CRC of all possible eight bit values.  This is
Packit Service 20376f
  all the information needed to generate CRCs on data a byte at a time for all
Packit Service 20376f
  combinations of CRC register values and incoming bytes.  The remaining tables
Packit Service 20376f
  allow for word-at-a-time CRC calculation for both big-endian and little-
Packit Service 20376f
  endian machines, where a word is four bytes.
Packit Service 20376f
*/
Packit Service 20376f
local void make_crc_table()
Packit Service 20376f
{
Packit Service 20376f
    z_crc_t c;
Packit Service 20376f
    int n, k;
Packit Service 20376f
    z_crc_t poly;                       /* polynomial exclusive-or pattern */
Packit Service 20376f
    /* terms of polynomial defining this crc (except x^32): */
Packit Service 20376f
    static volatile int first = 1;      /* flag to limit concurrent making */
Packit Service 20376f
    static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
Packit Service 20376f
Packit Service 20376f
    /* See if another task is already doing this (not thread-safe, but better
Packit Service 20376f
       than nothing -- significantly reduces duration of vulnerability in
Packit Service 20376f
       case the advice about DYNAMIC_CRC_TABLE is ignored) */
Packit Service 20376f
    if (first) {
Packit Service 20376f
        first = 0;
Packit Service 20376f
Packit Service 20376f
        /* make exclusive-or pattern from polynomial (0xedb88320UL) */
Packit Service 20376f
        poly = 0;
Packit Service 20376f
        for (n = 0; n < (int)(sizeof(p)/sizeof(unsigned char)); n++)
Packit Service 20376f
            poly |= (z_crc_t)1 << (31 - p[n]);
Packit Service 20376f
Packit Service 20376f
        /* generate a crc for every 8-bit value */
Packit Service 20376f
        for (n = 0; n < 256; n++) {
Packit Service 20376f
            c = (z_crc_t)n;
Packit Service 20376f
            for (k = 0; k < 8; k++)
Packit Service 20376f
                c = c & 1 ? poly ^ (c >> 1) : c >> 1;
Packit Service 20376f
            crc_table[0][n] = c;
Packit Service 20376f
        }
Packit Service 20376f
Packit Service 20376f
#ifdef BYFOUR
Packit Service 20376f
        /* generate crc for each value followed by one, two, and three zeros,
Packit Service 20376f
           and then the byte reversal of those as well as the first table */
Packit Service 20376f
        for (n = 0; n < 256; n++) {
Packit Service 20376f
            c = crc_table[0][n];
Packit Service 20376f
            crc_table[4][n] = ZSWAP32(c);
Packit Service 20376f
            for (k = 1; k < 4; k++) {
Packit Service 20376f
                c = crc_table[0][c & 0xff] ^ (c >> 8);
Packit Service 20376f
                crc_table[k][n] = c;
Packit Service 20376f
                crc_table[k + 4][n] = ZSWAP32(c);
Packit Service 20376f
            }
Packit Service 20376f
        }
Packit Service 20376f
#endif /* BYFOUR */
Packit Service 20376f
Packit Service 20376f
        crc_table_empty = 0;
Packit Service 20376f
    }
Packit Service 20376f
    else {      /* not first */
Packit Service 20376f
        /* wait for the other guy to finish (not efficient, but rare) */
Packit Service 20376f
        while (crc_table_empty)
Packit Service 20376f
            ;
Packit Service 20376f
    }
Packit Service 20376f
Packit Service 20376f
#ifdef MAKECRCH
Packit Service 20376f
    /* write out CRC tables to crc32.h */
Packit Service 20376f
    {
Packit Service 20376f
        FILE *out;
Packit Service 20376f
Packit Service 20376f
        out = fopen("crc32.h", "w");
Packit Service 20376f
        if (out == NULL) return;
Packit Service 20376f
        fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n");
Packit Service 20376f
        fprintf(out, " * Generated automatically by crc32.c\n */\n\n");
Packit Service 20376f
        fprintf(out, "local const z_crc_t FAR ");
Packit Service 20376f
        fprintf(out, "crc_table[TBLS][256] =\n{\n  {\n");
Packit Service 20376f
        write_table(out, crc_table[0]);
Packit Service 20376f
#  ifdef BYFOUR
Packit Service 20376f
        fprintf(out, "#ifdef BYFOUR\n");
Packit Service 20376f
        for (k = 1; k < 8; k++) {
Packit Service 20376f
            fprintf(out, "  },\n  {\n");
Packit Service 20376f
            write_table(out, crc_table[k]);
Packit Service 20376f
        }
Packit Service 20376f
        fprintf(out, "#endif\n");
Packit Service 20376f
#  endif /* BYFOUR */
Packit Service 20376f
        fprintf(out, "  }\n};\n");
Packit Service 20376f
        fclose(out);
Packit Service 20376f
    }
Packit Service 20376f
#endif /* MAKECRCH */
Packit Service 20376f
}
Packit Service 20376f
Packit Service 20376f
#ifdef MAKECRCH
Packit Service 20376f
local void write_table(out, table)
Packit Service 20376f
    FILE *out;
Packit Service 20376f
    const z_crc_t FAR *table;
Packit Service 20376f
{
Packit Service 20376f
    int n;
Packit Service 20376f
Packit Service 20376f
    for (n = 0; n < 256; n++)
Packit Service 20376f
        fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : "    ",
Packit Service 20376f
                (unsigned long)(table[n]),
Packit Service 20376f
                n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", "));
Packit Service 20376f
}
Packit Service 20376f
#endif /* MAKECRCH */
Packit Service 20376f
Packit Service 20376f
#else /* !DYNAMIC_CRC_TABLE */
Packit Service 20376f
/* ========================================================================
Packit Service 20376f
 * Tables of CRC-32s of all single-byte values, made by make_crc_table().
Packit Service 20376f
 */
Packit Service 20376f
#include "crc32.h"
Packit Service 20376f
#endif /* DYNAMIC_CRC_TABLE */
Packit Service 20376f
Packit Service 20376f
/* =========================================================================
Packit Service 20376f
 * This function can be used by asm versions of crc32()
Packit Service 20376f
 */
Packit Service 20376f
const z_crc_t FAR * ZEXPORT get_crc_table()
Packit Service 20376f
{
Packit Service 20376f
#ifdef DYNAMIC_CRC_TABLE
Packit Service 20376f
    if (crc_table_empty)
Packit Service 20376f
        make_crc_table();
Packit Service 20376f
#endif /* DYNAMIC_CRC_TABLE */
Packit Service 20376f
    return (const z_crc_t FAR *)crc_table;
Packit Service 20376f
}
Packit Service 20376f
Packit Service 20376f
/* ========================================================================= */
Packit Service 20376f
#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8)
Packit Service 20376f
#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1
Packit Service 20376f
Packit Service 20376f
/* ========================================================================= */
Packit Service 20376f
unsigned long ZEXPORT crc32_z(crc, buf, len)
Packit Service 20376f
    unsigned long crc;
Packit Service 20376f
    const unsigned char FAR *buf;
Packit Service 20376f
    z_size_t len;
Packit Service 20376f
{
Packit Service 20376f
    if (buf == Z_NULL) return 0UL;
Packit Service 20376f
Packit Service 20376f
#ifdef DYNAMIC_CRC_TABLE
Packit Service 20376f
    if (crc_table_empty)
Packit Service 20376f
        make_crc_table();
Packit Service 20376f
#endif /* DYNAMIC_CRC_TABLE */
Packit Service 20376f
Packit Service 20376f
#ifdef BYFOUR
Packit Service 20376f
    if (sizeof(void *) == sizeof(ptrdiff_t)) {
Packit Service 20376f
        z_crc_t endian;
Packit Service 20376f
Packit Service 20376f
        endian = 1;
Packit Service 20376f
        if (*((unsigned char *)(&endian)))
Packit Service 20376f
            return crc32_little(crc, buf, len);
Packit Service 20376f
        else
Packit Service 20376f
            return crc32_big(crc, buf, len);
Packit Service 20376f
    }
Packit Service 20376f
#endif /* BYFOUR */
Packit Service 20376f
    crc = crc ^ 0xffffffffUL;
Packit Service 20376f
    while (len >= 8) {
Packit Service 20376f
        DO8;
Packit Service 20376f
        len -= 8;
Packit Service 20376f
    }
Packit Service 20376f
    if (len) do {
Packit Service 20376f
        DO1;
Packit Service 20376f
    } while (--len);
Packit Service 20376f
    return crc ^ 0xffffffffUL;
Packit Service 20376f
}
Packit Service 20376f
Packit Service 20376f
/* ========================================================================= */
Packit Service 20376f
unsigned long ZEXPORT crc32(crc, buf, len)
Packit Service 20376f
    unsigned long crc;
Packit Service 20376f
    const unsigned char FAR *buf;
Packit Service 20376f
    uInt len;
Packit Service 20376f
{
Packit Service 20376f
    return crc32_z(crc, buf, len);
Packit Service 20376f
}
Packit Service 20376f
Packit Service 20376f
#ifdef BYFOUR
Packit Service 20376f
Packit Service 20376f
/*
Packit Service 20376f
   This BYFOUR code accesses the passed unsigned char * buffer with a 32-bit
Packit Service 20376f
   integer pointer type. This violates the strict aliasing rule, where a
Packit Service 20376f
   compiler can assume, for optimization purposes, that two pointers to
Packit Service 20376f
   fundamentally different types won't ever point to the same memory. This can
Packit Service 20376f
   manifest as a problem only if one of the pointers is written to. This code
Packit Service 20376f
   only reads from those pointers. So long as this code remains isolated in
Packit Service 20376f
   this compilation unit, there won't be a problem. For this reason, this code
Packit Service 20376f
   should not be copied and pasted into a compilation unit in which other code
Packit Service 20376f
   writes to the buffer that is passed to these routines.
Packit Service 20376f
 */
Packit Service 20376f
Packit Service 20376f
/* ========================================================================= */
Packit Service 20376f
#define DOLIT4 c ^= *buf4++; \
Packit Service 20376f
        c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \
Packit Service 20376f
            crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24]
Packit Service 20376f
#define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4
Packit Service 20376f
Packit Service 20376f
/* ========================================================================= */
Packit Service 20376f
local unsigned long crc32_little(crc, buf, len)
Packit Service 20376f
    unsigned long crc;
Packit Service 20376f
    const unsigned char FAR *buf;
Packit Service 20376f
    z_size_t len;
Packit Service 20376f
{
Packit Service 20376f
    register z_crc_t c;
Packit Service 20376f
    register const z_crc_t FAR *buf4;
Packit Service 20376f
Packit Service 20376f
    c = (z_crc_t)crc;
Packit Service 20376f
    c = ~c;
Packit Service 20376f
    while (len && ((ptrdiff_t)buf & 3)) {
Packit Service 20376f
        c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
Packit Service 20376f
        len--;
Packit Service 20376f
    }
Packit Service 20376f
Packit Service 20376f
    buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
Packit Service 20376f
    while (len >= 32) {
Packit Service 20376f
        DOLIT32;
Packit Service 20376f
        len -= 32;
Packit Service 20376f
    }
Packit Service 20376f
    while (len >= 4) {
Packit Service 20376f
        DOLIT4;
Packit Service 20376f
        len -= 4;
Packit Service 20376f
    }
Packit Service 20376f
    buf = (const unsigned char FAR *)buf4;
Packit Service 20376f
Packit Service 20376f
    if (len) do {
Packit Service 20376f
        c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
Packit Service 20376f
    } while (--len);
Packit Service 20376f
    c = ~c;
Packit Service 20376f
    return (unsigned long)c;
Packit Service 20376f
}
Packit Service 20376f
Packit Service 20376f
/* ========================================================================= */
Packit Service 20376f
#define DOBIG4 c ^= *buf4++; \
Packit Service 20376f
        c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \
Packit Service 20376f
            crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24]
Packit Service 20376f
#define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4
Packit Service 20376f
Packit Service 20376f
/* ========================================================================= */
Packit Service 20376f
local unsigned long crc32_big(crc, buf, len)
Packit Service 20376f
    unsigned long crc;
Packit Service 20376f
    const unsigned char FAR *buf;
Packit Service 20376f
    z_size_t len;
Packit Service 20376f
{
Packit Service 20376f
    register z_crc_t c;
Packit Service 20376f
    register const z_crc_t FAR *buf4;
Packit Service 20376f
Packit Service 20376f
    c = ZSWAP32((z_crc_t)crc);
Packit Service 20376f
    c = ~c;
Packit Service 20376f
    while (len && ((ptrdiff_t)buf & 3)) {
Packit Service 20376f
        c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
Packit Service 20376f
        len--;
Packit Service 20376f
    }
Packit Service 20376f
Packit Service 20376f
    buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
Packit Service 20376f
    while (len >= 32) {
Packit Service 20376f
        DOBIG32;
Packit Service 20376f
        len -= 32;
Packit Service 20376f
    }
Packit Service 20376f
    while (len >= 4) {
Packit Service 20376f
        DOBIG4;
Packit Service 20376f
        len -= 4;
Packit Service 20376f
    }
Packit Service 20376f
    buf = (const unsigned char FAR *)buf4;
Packit Service 20376f
Packit Service 20376f
    if (len) do {
Packit Service 20376f
        c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
Packit Service 20376f
    } while (--len);
Packit Service 20376f
    c = ~c;
Packit Service 20376f
    return (unsigned long)(ZSWAP32(c));
Packit Service 20376f
}
Packit Service 20376f
Packit Service 20376f
#endif /* BYFOUR */
Packit Service 20376f
Packit Service 20376f
#define GF2_DIM 32      /* dimension of GF(2) vectors (length of CRC) */
Packit Service 20376f
Packit Service 20376f
/* ========================================================================= */
Packit Service 20376f
local unsigned long gf2_matrix_times(mat, vec)
Packit Service 20376f
    unsigned long *mat;
Packit Service 20376f
    unsigned long vec;
Packit Service 20376f
{
Packit Service 20376f
    unsigned long sum;
Packit Service 20376f
Packit Service 20376f
    sum = 0;
Packit Service 20376f
    while (vec) {
Packit Service 20376f
        if (vec & 1)
Packit Service 20376f
            sum ^= *mat;
Packit Service 20376f
        vec >>= 1;
Packit Service 20376f
        mat++;
Packit Service 20376f
    }
Packit Service 20376f
    return sum;
Packit Service 20376f
}
Packit Service 20376f
Packit Service 20376f
/* ========================================================================= */
Packit Service 20376f
local void gf2_matrix_square(square, mat)
Packit Service 20376f
    unsigned long *square;
Packit Service 20376f
    unsigned long *mat;
Packit Service 20376f
{
Packit Service 20376f
    int n;
Packit Service 20376f
Packit Service 20376f
    for (n = 0; n < GF2_DIM; n++)
Packit Service 20376f
        square[n] = gf2_matrix_times(mat, mat[n]);
Packit Service 20376f
}
Packit Service 20376f
Packit Service 20376f
/* ========================================================================= */
Packit Service 20376f
local uLong crc32_combine_(crc1, crc2, len2)
Packit Service 20376f
    uLong crc1;
Packit Service 20376f
    uLong crc2;
Packit Service 20376f
    z_off64_t len2;
Packit Service 20376f
{
Packit Service 20376f
    int n;
Packit Service 20376f
    unsigned long row;
Packit Service 20376f
    unsigned long even[GF2_DIM];    /* even-power-of-two zeros operator */
Packit Service 20376f
    unsigned long odd[GF2_DIM];     /* odd-power-of-two zeros operator */
Packit Service 20376f
Packit Service 20376f
    /* degenerate case (also disallow negative lengths) */
Packit Service 20376f
    if (len2 <= 0)
Packit Service 20376f
        return crc1;
Packit Service 20376f
Packit Service 20376f
    /* put operator for one zero bit in odd */
Packit Service 20376f
    odd[0] = 0xedb88320UL;          /* CRC-32 polynomial */
Packit Service 20376f
    row = 1;
Packit Service 20376f
    for (n = 1; n < GF2_DIM; n++) {
Packit Service 20376f
        odd[n] = row;
Packit Service 20376f
        row <<= 1;
Packit Service 20376f
    }
Packit Service 20376f
Packit Service 20376f
    /* put operator for two zero bits in even */
Packit Service 20376f
    gf2_matrix_square(even, odd);
Packit Service 20376f
Packit Service 20376f
    /* put operator for four zero bits in odd */
Packit Service 20376f
    gf2_matrix_square(odd, even);
Packit Service 20376f
Packit Service 20376f
    /* apply len2 zeros to crc1 (first square will put the operator for one
Packit Service 20376f
       zero byte, eight zero bits, in even) */
Packit Service 20376f
    do {
Packit Service 20376f
        /* apply zeros operator for this bit of len2 */
Packit Service 20376f
        gf2_matrix_square(even, odd);
Packit Service 20376f
        if (len2 & 1)
Packit Service 20376f
            crc1 = gf2_matrix_times(even, crc1);
Packit Service 20376f
        len2 >>= 1;
Packit Service 20376f
Packit Service 20376f
        /* if no more bits set, then done */
Packit Service 20376f
        if (len2 == 0)
Packit Service 20376f
            break;
Packit Service 20376f
Packit Service 20376f
        /* another iteration of the loop with odd and even swapped */
Packit Service 20376f
        gf2_matrix_square(odd, even);
Packit Service 20376f
        if (len2 & 1)
Packit Service 20376f
            crc1 = gf2_matrix_times(odd, crc1);
Packit Service 20376f
        len2 >>= 1;
Packit Service 20376f
Packit Service 20376f
        /* if no more bits set, then done */
Packit Service 20376f
    } while (len2 != 0);
Packit Service 20376f
Packit Service 20376f
    /* return combined crc */
Packit Service 20376f
    crc1 ^= crc2;
Packit Service 20376f
    return crc1;
Packit Service 20376f
}
Packit Service 20376f
Packit Service 20376f
/* ========================================================================= */
Packit Service 20376f
uLong ZEXPORT crc32_combine(crc1, crc2, len2)
Packit Service 20376f
    uLong crc1;
Packit Service 20376f
    uLong crc2;
Packit Service 20376f
    z_off_t len2;
Packit Service 20376f
{
Packit Service 20376f
    return crc32_combine_(crc1, crc2, len2);
Packit Service 20376f
}
Packit Service 20376f
Packit Service 20376f
uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
Packit Service 20376f
    uLong crc1;
Packit Service 20376f
    uLong crc2;
Packit Service 20376f
    z_off64_t len2;
Packit Service 20376f
{
Packit Service 20376f
    return crc32_combine_(crc1, crc2, len2);
Packit Service 20376f
}