Rizin
unix-like reverse engineering framework and cli tools
fletcher.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2021 deroad <wargio@libero.it>
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
4 #ifndef RZ_FLETCHER_H
5 #define RZ_FLETCHER_H
6 
7 #include <rz_types.h>
8 
9 #define RZ_HASH_FLETCHER8_DIGEST_SIZE 1
10 #define RZ_HASH_FLETCHER_BLOCK_LENGTH 0
11 
12 typedef struct fletcher8_t {
15 
17 bool rz_fletcher8_update(RzFletcher8 *ctx, const ut8 *data, size_t len);
18 bool rz_fletcher8_final(ut8 *digest, RzFletcher8 *ctx);
19 
20 #define RZ_HASH_FLETCHER16_DIGEST_SIZE 2
21 
22 typedef struct fletcher16_t {
25 
27 bool rz_fletcher16_update(RzFletcher16 *ctx, const ut8 *data, size_t len);
28 bool rz_fletcher16_final(ut8 *digest, RzFletcher16 *ctx);
29 
30 #define RZ_HASH_FLETCHER32_DIGEST_SIZE 4
31 
32 typedef struct fletcher32_t {
35 
37 bool rz_fletcher32_update(RzFletcher32 *ctx, const ut8 *data, size_t len);
38 bool rz_fletcher32_final(ut8 *digest, RzFletcher32 *ctx);
39 
40 #define RZ_HASH_FLETCHER64_DIGEST_SIZE 8
41 
42 typedef struct fletcher64_t {
45 
47 bool rz_fletcher64_update(RzFletcher64 *ctx, const ut8 *data, size_t len);
48 bool rz_fletcher64_final(ut8 *digest, RzFletcher64 *ctx);
49 
50 #endif /* RZ_FLETCHER_H */
size_t len
Definition: 6502dis.c:15
uint16_t ut16
uint32_t ut32
bool rz_fletcher64_final(ut8 *digest, RzFletcher64 *ctx)
Definition: fletcher.c:132
struct fletcher8_t RzFletcher8
bool rz_fletcher64_update(RzFletcher64 *ctx, const ut8 *data, size_t len)
Definition: fletcher.c:117
bool rz_fletcher32_final(ut8 *digest, RzFletcher32 *ctx)
Definition: fletcher.c:101
struct fletcher64_t RzFletcher64
struct fletcher32_t RzFletcher32
struct fletcher16_t RzFletcher16
bool rz_fletcher16_final(ut8 *digest, RzFletcher16 *ctx)
Definition: fletcher.c:58
bool rz_fletcher8_final(ut8 *digest, RzFletcher8 *ctx)
Definition: fletcher.c:26
bool rz_fletcher16_init(RzFletcher16 *ctx)
Definition: fletcher.c:34
bool rz_fletcher32_init(RzFletcher32 *ctx)
Definition: fletcher.c:68
bool rz_fletcher16_update(RzFletcher16 *ctx, const ut8 *data, size_t len)
Definition: fletcher.c:40
bool rz_fletcher8_update(RzFletcher8 *ctx, const ut8 *data, size_t len)
Definition: fletcher.c:15
bool rz_fletcher64_init(RzFletcher64 *ctx)
Definition: fletcher.c:111
bool rz_fletcher8_init(RzFletcher8 *ctx)
Definition: fletcher.c:9
bool rz_fletcher32_update(RzFletcher32 *ctx, const ut8 *data, size_t len)
Definition: fletcher.c:74
uint8_t ut8
Definition: lh5801.h:11
ut32 high
Definition: fletcher.h:23
ut32 low
Definition: fletcher.h:23
ut32 high
Definition: fletcher.h:33
ut32 low
Definition: fletcher.h:33
ut32 high
Definition: fletcher.h:43
ut32 low
Definition: fletcher.h:43
ut16 high
Definition: fletcher.h:13
ut16 low
Definition: fletcher.h:13