Last change
on this file since c8eeadd was
52744f8,
checked in by Wilmer van der Gaast <wilmer@…>, at 2008-01-17T22:06:55Z
|
Fixing some Solaris compiler warnings (u_int->uint, adding some typecasts
for pid_t variables).
|
-
Property mode set to
100644
|
File size:
1.3 KB
|
Rev | Line | |
---|
[b7d3cc34] | 1 | /* |
---|
[df6d1da] | 2 | * MD5 hashing code copied from Lepton's crack <http://usuarios.lycos.es/reinob/> |
---|
| 3 | * |
---|
| 4 | * Adapted to be API-compatible with the previous (GPL-incompatible) code. |
---|
[b7d3cc34] | 5 | */ |
---|
| 6 | |
---|
[df6d1da] | 7 | /* |
---|
| 8 | * This code implements the MD5 message-digest algorithm. |
---|
| 9 | * The algorithm is due to Ron Rivest. This code was |
---|
| 10 | * written by Colin Plumb in 1993, no copyright is claimed. |
---|
| 11 | * This code is in the public domain; do with it what you wish. |
---|
| 12 | * |
---|
| 13 | * Equivalent code is available from RSA Data Security, Inc. |
---|
| 14 | * This code has been tested against that, and is equivalent, |
---|
| 15 | * except that you don't need to include two pages of legalese |
---|
| 16 | * with every copy. |
---|
| 17 | * |
---|
| 18 | * To compute the message digest of a chunk of bytes, declare an |
---|
| 19 | * MD5Context structure, pass it to MD5Init, call MD5Update as |
---|
| 20 | * needed on buffers full of bytes, and then call MD5Final, which |
---|
| 21 | * will fill a supplied 16-byte array with the digest. |
---|
[b7d3cc34] | 22 | */ |
---|
| 23 | |
---|
[df6d1da] | 24 | #ifndef _MD5_H |
---|
| 25 | #define _MD5_H |
---|
[b7d3cc34] | 26 | |
---|
[df6d1da] | 27 | #include <sys/types.h> |
---|
[b7d3cc34] | 28 | #include <gmodule.h> |
---|
[52744f8] | 29 | #include <stdint.h> |
---|
[b7d3cc34] | 30 | |
---|
[52744f8] | 31 | typedef uint8_t md5_byte_t; |
---|
[df6d1da] | 32 | typedef struct MD5Context { |
---|
[52744f8] | 33 | uint32_t buf[4]; |
---|
| 34 | uint32_t bits[2]; |
---|
[df6d1da] | 35 | unsigned char in[64]; |
---|
[b7d3cc34] | 36 | } md5_state_t; |
---|
| 37 | |
---|
[df6d1da] | 38 | G_MODULE_EXPORT void md5_init(struct MD5Context *context); |
---|
| 39 | G_MODULE_EXPORT void md5_append(struct MD5Context *context, const md5_byte_t *buf, unsigned int len); |
---|
| 40 | G_MODULE_EXPORT void md5_finish(struct MD5Context *context, md5_byte_t digest[16]); |
---|
[b7d3cc34] | 41 | |
---|
| 42 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.