Rizin
unix-like reverse engineering framework and cli tools
md5.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 1999 Alan DeKok <aland@ox.org>
2 // SPDX-License-Identifier: LGPL-2.1-or-later
3 
4 #ifndef RZ_HASH_MD5_H
5 #define RZ_HASH_MD5_H
6 
7 #include <rz_types.h>
8 
9 #define RZ_HASH_MD5_DIGEST_SIZE 0x10
10 #define RZ_HASH_MD5_BLOCK_LENGTH 0x40
11 
12 #include <string.h>
13 
14 /* The below was retrieved from
15  * http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/crypto/md5.h?rev=1.1
16  * With the following changes: uint64_t => ut32[2]
17  * Commented out #include <sys/cdefs.h>
18  * Commented out the __BEGIN and __END _DECLS, and the __attributes.
19  */
20 
21 /*
22  * This code implements the MD5 message-digest algorithm.
23  * The algorithm is due to Ron Rivest. This code was
24  * written by Colin Plumb in 1993, no copyright is claimed.
25  * This code is in the public domain; do with it what you wish.
26  *
27  * Equivalent code is available from RSA Data Security, Inc.
28  * This code has been tested against that, and is equivalent,
29  * except that you don't need to include two pages of legalese
30  * with every copy.
31  */
32 
33 #define MD5_BLOCK_LENGTH 64
34 #define MD5_DIGEST_LENGTH 16
35 
36 typedef struct MD5Context {
37  ut32 state[4]; /* state */
38  ut32 count[2]; /* number of bits, mod 2^64 */
39  ut8 buffer[MD5_BLOCK_LENGTH]; /* input buffer */
41 
43 RZ_IPI void rz_MD5Update(rz_MD5_CTX *, const ut8 *, size_t);
45 
46 #endif /* RZ_HASH_MD5_H */
#define RZ_IPI
Definition: analysis_wasm.c:11
uint32_t ut32
uint8_t ut8
Definition: lh5801.h:11
#define MD5_DIGEST_LENGTH
Definition: md5.h:34
struct MD5Context rz_MD5_CTX
RZ_IPI void rz_MD5Final(ut8[MD5_DIGEST_LENGTH], rz_MD5_CTX *)
Definition: md5.c:218
#define MD5_BLOCK_LENGTH
Definition: md5.h:33
RZ_IPI void rz_MD5Init(rz_MD5_CTX *)
Definition: md5.c:163
RZ_IPI void rz_MD5Update(rz_MD5_CTX *, const ut8 *, size_t)
Definition: md5.c:176
Definition: md5.h:36
ut32 count[2]
Definition: md5.h:38
Definition: buffer.h:15
Definition: dis.h:43