pngcrush  1.8.13
About: Pngcrush is an optimizer for PNG (Portable Network Graphics) files.
  Fossies Dox: pngcrush-1.8.13.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

crc32.c File Reference
#include "zutil.h"
#include "crc32.h"
Include dependency graph for crc32.c:

Go to the source code of this file.

Macros

#define TBLS   1
 
#define DO1   crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8)
 
#define DO8   DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1
 
#define GF2_DIM   32 /* dimension of GF(2) vectors (length of CRC) */
 

Functions

static unsigned long gf2_matrix_times ()
 
static void gf2_matrix_square ()
 
static uLong crc32_combine_ ()
 
const z_crc_tget_crc_table ()
 
unsigned long crc32_z (unsigned long crc, const unsigned char *buf, z_size_t len)
 
unsigned long crc32 (unsigned long crc, const unsigned char *buf, uInt len)
 
static unsigned long gf2_matrix_times (unsigned long *mat, unsigned long vec)
 
static void gf2_matrix_square (unsigned long *square, unsigned long *mat)
 
static uLong crc32_combine_ (uLong crc1, uLong crc2, long len2)
 
uLong crc32_combine (uLong crc1, uLong crc2, long len2)
 
uLong crc32_combine64 (uLong crc1, uLong crc2, long len2)
 

Macro Definition Documentation

◆ DO1

#define DO1   crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8)

Definition at line 198 of file crc32.c.

◆ DO8

#define DO8   DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1

Definition at line 199 of file crc32.c.

◆ GF2_DIM

#define GF2_DIM   32 /* dimension of GF(2) vectors (length of CRC) */

Definition at line 341 of file crc32.c.

◆ TBLS

#define TBLS   1

Definition at line 44 of file crc32.c.

Function Documentation

◆ crc32()

unsigned long crc32 ( unsigned long  crc,
const unsigned char *  buf,
uInt  len 
)

◆ crc32_combine()

uLong crc32_combine ( uLong  crc1,
uLong  crc2,
long  len2 
)

Definition at line 428 of file crc32.c.

References crc32_combine_().

◆ crc32_combine64()

uLong crc32_combine64 ( uLong  crc1,
uLong  crc2,
long  len2 
)

Definition at line 436 of file crc32.c.

References crc32_combine_().

◆ crc32_combine_() [1/2]

static uLong crc32_combine_ ( )
static

Referenced by crc32_combine(), and crc32_combine64().

◆ crc32_combine_() [2/2]

static uLong crc32_combine_ ( uLong  crc1,
uLong  crc2,
long  len2 
)
static

Definition at line 372 of file crc32.c.

References GF2_DIM, gf2_matrix_square(), and gf2_matrix_times().

◆ crc32_z()

unsigned long crc32_z ( unsigned long  crc,
const unsigned char *  buf,
z_size_t  len 
)

Definition at line 202 of file crc32.c.

References crc, DO1, DO8, and Z_NULL.

Referenced by crc32().

◆ get_crc_table()

const z_crc_t* get_crc_table ( )

Definition at line 188 of file crc32.c.

References crc_table, and FAR.

◆ gf2_matrix_square() [1/2]

static void gf2_matrix_square ( )
static

Referenced by crc32_combine_().

◆ gf2_matrix_square() [2/2]

static void gf2_matrix_square ( unsigned long *  square,
unsigned long *  mat 
)
static

Definition at line 361 of file crc32.c.

References GF2_DIM, and gf2_matrix_times().

◆ gf2_matrix_times() [1/2]

static unsigned long gf2_matrix_times ( )
static

◆ gf2_matrix_times() [2/2]

static unsigned long gf2_matrix_times ( unsigned long *  mat,
unsigned long  vec 
)
static

Definition at line 344 of file crc32.c.