Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
crc32.h
Go to the documentation of this file.
1
11#ifndef __CRC32_H__
12#define __CRC32_H__
13
14#include <wireshark.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif /* __cplusplus */
19
20#define CRC32_CCITT_SEED 0xFFFFFFFF
21#define CRC32C_PRELOAD 0xffffffff
22#define CRC32_MPEG2_SEED 0xFFFFFFFF
23
24/*
25 * Byte swap fix contributed by Dave Wysochanski <[email protected]>.
26 */
27#define CRC32C_SWAP(crc32c_value) \
28 (((crc32c_value & 0xff000000) >> 24) | \
29 ((crc32c_value & 0x00ff0000) >> 8) | \
30 ((crc32c_value & 0x0000ff00) << 8) | \
31 ((crc32c_value & 0x000000ff) << 24))
32
43WS_DLL_PUBLIC uint32_t crc32_ccitt_table_lookup (unsigned char pos);
44
47WS_DLL_PUBLIC uint32_t crc32c_table_lookup (unsigned char pos);
48
55WS_DLL_PUBLIC uint32_t crc32c_calculate(const void *buf, int len, uint32_t crc);
56
64WS_DLL_PUBLIC uint32_t crc32c_calculate_no_swap(const void *buf, int len, uint32_t crc);
65
71WS_DLL_PUBLIC uint32_t crc32_ccitt(const uint8_t *buf, unsigned len);
72
82WS_DLL_PUBLIC uint32_t crc32_ccitt_seed(const uint8_t *buf, unsigned len, uint32_t seed);
83
90WS_DLL_PUBLIC uint32_t crc32_mpeg2_seed(const uint8_t *buf, unsigned len, uint32_t seed);
91
100WS_DLL_PUBLIC uint32_t crc32_0x0AA725CF_seed(const uint8_t *buf, unsigned len, uint32_t seed);
101
110WS_DLL_PUBLIC uint32_t crc32_0x5D6DCB_seed(const uint8_t *buf, unsigned len, uint32_t seed);
111
128WS_DLL_PUBLIC int Dot11DecryptWepDecrypt(
129 const unsigned char *seed,
130 const size_t seed_len,
131 unsigned char *cypher_text,
132 const size_t data_len);
133
134#ifdef __cplusplus
135}
136#endif /* __cplusplus */
137
138#endif /* crc32.h */
WS_DLL_PUBLIC uint32_t crc32_0x0AA725CF_seed(const uint8_t *buf, unsigned len, uint32_t seed)
Computes CRC32 checksum for the given data with the polynom 0x0AA725CF using precompiled CRC table.
Definition crc32.c:427
WS_DLL_PUBLIC uint32_t crc32_ccitt(const uint8_t *buf, unsigned len)
Compute CRC32 CCITT checksum of a buffer of data.
Definition crc32.c:391
WS_DLL_PUBLIC uint32_t crc32c_table_lookup(unsigned char pos)
Definition crc32.c:357
WS_DLL_PUBLIC uint32_t crc32c_calculate_no_swap(const void *buf, int len, uint32_t crc)
Compute CRC32C checksum of a buffer of data without swapping seed crc or completed checksum.
Definition crc32.c:380
WS_DLL_PUBLIC uint32_t crc32c_calculate(const void *buf, int len, uint32_t crc)
Compute CRC32C checksum of a buffer of data.
Definition crc32.c:369
WS_DLL_PUBLIC uint32_t crc32_ccitt_table_lookup(unsigned char pos)
Lookup a CRC-32/CCITT table value by position.
Definition crc32.c:363
WS_DLL_PUBLIC int Dot11DecryptWepDecrypt(const unsigned char *seed, const size_t seed_len, unsigned char *cypher_text, const size_t data_len)
Decrypt WEP-encrypted 802.11 payload using RC4 stream cipher.
Definition dot11decrypt_wep.c:23
WS_DLL_PUBLIC uint32_t crc32_ccitt_seed(const uint8_t *buf, unsigned len, uint32_t seed)
Compute CRC32 CCITT checksum of a buffer of data.
Definition crc32.c:397
WS_DLL_PUBLIC uint32_t crc32_0x5D6DCB_seed(const uint8_t *buf, unsigned len, uint32_t seed)
Computes CRC32 checksum for the given data with the polynom 0x5D6DCB using precompiled CRC table.
Definition crc32.c:439
WS_DLL_PUBLIC uint32_t crc32_mpeg2_seed(const uint8_t *buf, unsigned len, uint32_t seed)
Compute MPEG-2 CRC32 checksum of a buffer of data.
Definition crc32.c:413