Functions | Variables

/tmp/buildd/xz-utils-5.0.0/src/liblzma/check/crc32_small.c File Reference

CRC32 calculation (size-optimized). More...

#include "check.h"

Functions

static void crc32_init (void)
void lzma_crc32_init (void)
uint32_t lzma_crc32 (const uint8_t *buf, size_t size, uint32_t crc)
 Calculate CRC32.

Variables

uint32_t lzma_crc32_table [1][256]

Detailed Description

CRC32 calculation (size-optimized).


Function Documentation

uint32_t lzma_crc32 ( const uint8_t *  buf,
size_t  size,
uint32_t  crc 
)

Calculate CRC32.

Calculate CRC32 using the polynomial from the IEEE 802.3 standard.

Parameters:
buf Pointer to the input buffer
size Size of the input buffer
crc Previously returned CRC value. This is used to calculate the CRC of a big buffer in smaller chunks. Set to zero when starting a new calculation.
Returns:
Updated CRC value, which can be passed to this function again to continue CRC calculation.

References lzma_crc32_table.

Referenced by lzma_block_header_decode(), lzma_block_header_encode(), lzma_check_update(), lzma_index_hash_decode(), lzma_stream_footer_decode(), lzma_stream_footer_encode(), lzma_stream_header_decode(), and lzma_stream_header_encode().


Variable Documentation

uint32_t lzma_crc32_table[1][256]

lzma_crc32_table[0] is needed by LZ encoder so we need to keep the array two-dimensional.

Referenced by lzma_crc32().