Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/md4.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*  $OpenBSD: md4.h,v 1.16 2012/12/05 23:19:57 deraadt Exp $    */
0002 
0003 /*
0004  * This code implements the MD4 message-digest algorithm.
0005  * The algorithm is due to Ron Rivest.  This code was
0006  * written by Colin Plumb in 1993, no copyright is claimed.
0007  * This code is in the public domain; do with it what you wish.
0008  * Todd C. Miller modified the MD5 code to do MD4 based on RFC 1186.
0009  *
0010  * Equivalent code is available from RSA Data Security, Inc.
0011  * This code has been tested against that, and is equivalent,
0012  * except that you don't need to include two pages of legalese
0013  * with every copy.
0014  */
0015 
0016 #ifndef _MD4_H_
0017 #define _MD4_H_
0018 
0019 #include <sys/types.h>
0020 
0021 #include <stdint.h>
0022 
0023 #define MD4_BLOCK_LENGTH        64
0024 #define MD4_DIGEST_LENGTH       16
0025 #define MD4_DIGEST_STRING_LENGTH    (MD4_DIGEST_LENGTH * 2 + 1)
0026 
0027 typedef struct MD4Context {
0028     uint32_t state[4];          /* state */
0029     uint64_t count;             /* number of bits, mod 2^64 */
0030     uint8_t buffer[MD4_BLOCK_LENGTH];   /* input buffer */
0031 } MD4_CTX;
0032 
0033 #ifdef __cplusplus
0034 extern "C" {
0035 #endif
0036 
0037 void     MD4Init(MD4_CTX *);
0038 void     MD4Update(MD4_CTX *, const uint8_t *, size_t);
0039 void     MD4Pad(MD4_CTX *);
0040 void     MD4Final(uint8_t [MD4_DIGEST_LENGTH], MD4_CTX *);
0041 void     MD4Transform(uint32_t [4], const uint8_t [MD4_BLOCK_LENGTH]);
0042 char    *MD4End(MD4_CTX *, char *);
0043 char    *MD4File(const char *, char *);
0044 char    *MD4FileChunk(const char *, char *, off_t, off_t);
0045 char    *MD4Data(const uint8_t *, size_t, char *);
0046 
0047 #ifdef __cplusplus
0048 }
0049 #endif
0050 
0051 #endif /* _MD4_H_ */