xref: /btstack/3rd-party/md5/md5.h (revision 9201a494d123d302028720935d5a7154c1951713)
1*9201a494SMatthias Ringwald /*
2*9201a494SMatthias Ringwald  * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc.
3*9201a494SMatthias Ringwald  * MD5 Message-Digest Algorithm (RFC 1321).
4*9201a494SMatthias Ringwald  *
5*9201a494SMatthias Ringwald  * Homepage:
6*9201a494SMatthias Ringwald  * http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5
7*9201a494SMatthias Ringwald  *
8*9201a494SMatthias Ringwald  * Author:
9*9201a494SMatthias Ringwald  * Alexander Peslyak, better known as Solar Designer <solar at openwall.com>
10*9201a494SMatthias Ringwald  *
11*9201a494SMatthias Ringwald  * This software was written by Alexander Peslyak in 2001.  No copyright is
12*9201a494SMatthias Ringwald  * claimed, and the software is hereby placed in the public domain.
13*9201a494SMatthias Ringwald  * In case this attempt to disclaim copyright and place the software in the
14*9201a494SMatthias Ringwald  * public domain is deemed null and void, then the software is
15*9201a494SMatthias Ringwald  * Copyright (c) 2001 Alexander Peslyak and it is hereby released to the
16*9201a494SMatthias Ringwald  * general public under the following terms:
17*9201a494SMatthias Ringwald  *
18*9201a494SMatthias Ringwald  * Redistribution and use in source and binary forms, with or without
19*9201a494SMatthias Ringwald  * modification, are permitted.
20*9201a494SMatthias Ringwald  *
21*9201a494SMatthias Ringwald  * There's ABSOLUTELY NO WARRANTY, express or implied.
22*9201a494SMatthias Ringwald  *
23*9201a494SMatthias Ringwald  * See md5.c for more information.
24*9201a494SMatthias Ringwald  */
25*9201a494SMatthias Ringwald 
26*9201a494SMatthias Ringwald #ifdef HAVE_OPENSSL
27*9201a494SMatthias Ringwald #include <openssl/md5.h>
28*9201a494SMatthias Ringwald #elif !defined(_MD5_H)
29*9201a494SMatthias Ringwald #define _MD5_H
30*9201a494SMatthias Ringwald 
31*9201a494SMatthias Ringwald /* Any 32-bit or wider unsigned integer data type will do */
32*9201a494SMatthias Ringwald typedef unsigned int MD5_u32plus;
33*9201a494SMatthias Ringwald 
34*9201a494SMatthias Ringwald typedef struct {
35*9201a494SMatthias Ringwald 	MD5_u32plus lo, hi;
36*9201a494SMatthias Ringwald 	MD5_u32plus a, b, c, d;
37*9201a494SMatthias Ringwald 	unsigned char buffer[64];
38*9201a494SMatthias Ringwald 	MD5_u32plus block[16];
39*9201a494SMatthias Ringwald } MD5_CTX;
40*9201a494SMatthias Ringwald 
41*9201a494SMatthias Ringwald extern void MD5_Init(MD5_CTX *ctx);
42*9201a494SMatthias Ringwald extern void MD5_Update(MD5_CTX *ctx, const void *data, unsigned long size);
43*9201a494SMatthias Ringwald extern void MD5_Final(unsigned char *result, MD5_CTX *ctx);
44*9201a494SMatthias Ringwald 
45*9201a494SMatthias Ringwald #endif
46