Rizin
unix-like reverse engineering framework and cli tools
crca.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2009 Victor Mu~noz <vmunoz@ingenieria-inversa.cl>
2 // SPDX-FileCopyrightText: 2021 deroad <wargio@libero.it>
3 // SPDX-License-Identifier: LGPL-3.0-only
4 #ifndef RZ_CRCA_H
5 #define RZ_CRCA_H
6 
7 #include <rz_types.h>
8 
9 typedef ut64 utcrc;
10 #define UTCRC_C(x) ((utcrc)(x))
11 
12 typedef enum {
64 
67 
68 typedef struct {
71  int reflect;
74 } RzCrc;
75 
77 void crc_init_custom(RzCrc *ctx, utcrc crc, ut32 size, int reflect, utcrc poly, utcrc xout);
78 void crc_update(RzCrc *ctx, const ut8 *data, ut32 sz);
79 void crc_final(RzCrc *ctx, utcrc *r);
80 
81 #endif /* RZ_CRCA_H */
uint32_t preset
Definition: container.h:259
ut64 utcrc
Definition: crca.h:9
void crc_final(RzCrc *ctx, utcrc *r)
Definition: crca.c:38
RzCrcPresets
Definition: crca.h:12
@ CRC_PRESET_32
Definition: crca.h:49
@ CRC_PRESET_CRC32_MPEG2
Definition: crca.h:54
@ CRC_PRESET_CRC16_RIELLO
Definition: crca.h:39
@ CRC_PRESET_CRC16_TELEDISK
Definition: crca.h:41
@ CRC_PRESET_24
Definition: crca.h:48
@ CRC_PRESET_16_HDLC
Definition: crca.h:27
@ CRC_PRESET_CRC16_CDMA2000
Definition: crca.h:30
@ CRC_PRESET_CRC32_BZIP2
Definition: crca.h:52
@ CRC_PRESET_CRC8_ROHC
Definition: crca.h:21
@ CRC_PRESET_CRC16_X25
Definition: crca.h:46
@ CRC_PRESET_32C
Definition: crca.h:51
@ CRC_PRESET_CRC8_DVB_S2
Definition: crca.h:16
@ CRC_PRESET_CRC8_CDMA2000
Definition: crca.h:14
@ CRC_PRESET_CRC8_WCDMA
Definition: crca.h:22
@ CRC_PRESET_15_CAN
Definition: crca.h:23
@ CRC_PRESET_CRC16_AUG_CCITT
Definition: crca.h:28
@ CRC_PRESET_CRC16_MCRF4XX
Definition: crca.h:38
@ CRC_PRESET_16_USB
Definition: crca.h:26
@ CRC_PRESET_8_SMBUS
Definition: crca.h:13
@ CRC_PRESET_CRC16_GENIBUS
Definition: crca.h:36
@ CRC_PRESET_CRC32_JAMCRC
Definition: crca.h:57
@ CRC_PRESET_CRC32_XFER
Definition: crca.h:58
@ CRC_PRESET_CRCA
Definition: crca.h:43
@ CRC_PRESET_CRC16_DECT_R
Definition: crca.h:32
@ CRC_PRESET_16
Definition: crca.h:24
@ CRC_PRESET_CRC16_MAXIM
Definition: crca.h:37
@ CRC_PRESET_CRC64_XZ
Definition: crca.h:62
@ CRC_PRESET_CRC16_DDS110
Definition: crca.h:31
@ CRC_PRESET_16_CITT
Definition: crca.h:25
@ CRC_PRESET_32_ECMA_267
Definition: crca.h:50
@ CRC_PRESET_CRC8_DARC
Definition: crca.h:15
@ CRC_PRESET_CRC64_ISO
Definition: crca.h:63
@ CRC_PRESET_CRC64
Definition: crca.h:59
@ CRC_PRESET_CRC16_DECT_X
Definition: crca.h:33
@ CRC_PRESET_CRC8_ITU
Definition: crca.h:19
@ CRC_PRESET_SIZE
Definition: crca.h:65
@ CRC_PRESET_CRC16_MODBUS
Definition: crca.h:45
@ CRC_PRESET_CRC16_KERMIT
Definition: crca.h:44
@ CRC_PRESET_CRC8_EBU
Definition: crca.h:17
@ CRC_PRESET_CRC64_ECMA182
Definition: crca.h:60
@ CRC_PRESET_CRC16_BUYPASS
Definition: crca.h:29
@ CRC_PRESET_CRC32Q
Definition: crca.h:56
@ CRC_PRESET_CRC8_ICODE
Definition: crca.h:18
@ CRC_PRESET_CRC16_DNP
Definition: crca.h:34
@ CRC_PRESET_CRC16_TMS37157
Definition: crca.h:42
@ CRC_PRESET_CRC16_T10_DIF
Definition: crca.h:40
@ CRC_PRESET_CRC32_POSIX
Definition: crca.h:55
@ CRC_PRESET_CRC8_MAXIM
Definition: crca.h:20
@ CRC_PRESET_CRC16_XMODEM
Definition: crca.h:47
@ CRC_PRESET_CRC32D
Definition: crca.h:53
@ CRC_PRESET_CRC16_EN13757
Definition: crca.h:35
@ CRC_PRESET_CRC64_WE
Definition: crca.h:61
void crc_init_preset(RzCrc *ctx, RzCrcPresets preset)
Definition: crca.c:114
void crc_update(RzCrc *ctx, const ut8 *data, ut32 sz)
Definition: crca.c:16
void crc_init_custom(RzCrc *ctx, utcrc crc, ut32 size, int reflect, utcrc poly, utcrc xout)
Definition: crca.c:8
#define r
Definition: crypto_rc6.c:12
uint32_t ut32
voidpf void uLong size
Definition: ioapi.h:138
uint8_t ut8
Definition: lh5801.h:11
Definition: crca.h:68
int reflect
Definition: crca.h:71
utcrc poly
Definition: crca.h:72
utcrc crc
Definition: crca.h:69
ut32 size
Definition: crca.h:70
utcrc xout
Definition: crca.h:73
ut64(WINAPI *w32_GetEnabledXStateFeatures)()