Wireshark  4.3.0
The Wireshark network protocol analyzer
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
17 extern "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 <davidw@netapp.com>.
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 
35 WS_DLL_PUBLIC uint32_t crc32_ccitt_table_lookup (unsigned char pos);
36 
39 WS_DLL_PUBLIC uint32_t crc32c_table_lookup (unsigned char pos);
40 
46 WS_DLL_PUBLIC uint32_t crc32c_calculate(const void *buf, int len, uint32_t crc);
47 
54 WS_DLL_PUBLIC uint32_t crc32c_calculate_no_swap(const void *buf, int len, uint32_t crc);
55 
60 WS_DLL_PUBLIC uint32_t crc32_ccitt(const uint8_t *buf, unsigned len);
61 
69 WS_DLL_PUBLIC uint32_t crc32_ccitt_seed(const uint8_t *buf, unsigned len, uint32_t seed);
70 
76 WS_DLL_PUBLIC uint32_t crc32_mpeg2_seed(const uint8_t *buf, unsigned len, uint32_t seed);
77 
85 WS_DLL_PUBLIC uint32_t crc32_0x0AA725CF_seed(const uint8_t *buf, unsigned len, uint32_t seed);
86 
94 WS_DLL_PUBLIC uint32_t crc32_0x5D6DCB_seed(const uint8_t *buf, unsigned len, uint32_t seed);
95 
96 WS_DLL_PUBLIC int Dot11DecryptWepDecrypt(
97  const unsigned char *seed,
98  const size_t seed_len,
99  unsigned char *cypher_text,
100  const size_t data_len);
101 
102 #ifdef __cplusplus
103 }
104 #endif /* __cplusplus */
105 
106 #endif /* crc32.h */
WS_DLL_PUBLIC uint32_t crc32_0x0AA725CF_seed(const uint8_t *buf, unsigned len, uint32_t seed)
Definition: crc32.c:439
WS_DLL_PUBLIC uint32_t crc32_ccitt(const uint8_t *buf, unsigned len)
Definition: crc32.c:399
WS_DLL_PUBLIC uint32_t crc32c_table_lookup(unsigned char pos)
Definition: crc32.c:365
WS_DLL_PUBLIC uint32_t crc32c_calculate_no_swap(const void *buf, int len, uint32_t crc)
Definition: crc32.c:388
WS_DLL_PUBLIC uint32_t crc32c_calculate(const void *buf, int len, uint32_t crc)
Definition: crc32.c:377
WS_DLL_PUBLIC uint32_t crc32_ccitt_table_lookup(unsigned char pos)
Definition: crc32.c:371
WS_DLL_PUBLIC uint32_t crc32_ccitt_seed(const uint8_t *buf, unsigned len, uint32_t seed)
Definition: crc32.c:405
WS_DLL_PUBLIC uint32_t crc32_0x5D6DCB_seed(const uint8_t *buf, unsigned len, uint32_t seed)
Definition: crc32.c:451
WS_DLL_PUBLIC uint32_t crc32_mpeg2_seed(const uint8_t *buf, unsigned len, uint32_t seed)
Definition: crc32.c:425