OSDN Git Service

add sdl-1.3
[android-x86/external-stagefright-plugins.git] / SDL-1.3 / android-project / jni / SDL / test / test-automation / src / libSDLtest / fuzzer / utl_md5.h
1
2 /*
3  ***********************************************************************
4  ** utl_md5.h -- header file for implementation of MD5                  **
5  ** RSA Data Security, Inc. MD5 Message-Digest Algorithm              **
6  ** Created: 2/17/90 RLR                                              **
7  ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version               **
8  ** Revised (for MD5): RLR 4/27/91                                    **
9  **   -- G modified to have y&~z instead of y&z                       **
10  **   -- FF, GG, HH modified to add in last register done             **
11  **   -- Access pattern: round 2 works mod 5, round 3 works mod 3     **
12  **   -- distinct additive constant for each step                     **
13  **   -- round 4 added, working mod 7                                 **
14  ***********************************************************************
15 */
16
17 /*
18  ***********************************************************************
19  **  Message-digest routines:                                         **
20  **  To form the message digest for a message M                       **
21  **    (1) Initialize a context buffer mdContext using MD5Init        **
22  **    (2) Call MD5Update on mdContext and M                          **
23  **    (3) Call MD5Final on mdContext                                 **
24  **  The message digest is now in mdContext->digest[0...15]           **
25  ***********************************************************************
26 */
27
28 #ifndef _utl_md5_h
29 #define _utl_md5_h
30
31 /* Set up for C function definitions, even when using C++ */
32 #ifdef __cplusplus
33 extern    "C" {
34 #endif
35
36 /* ------------ Definitions --------- */
37
38 /* typedef a 32-bit type */
39   typedef unsigned long int MD5UINT4;
40
41 /* Data structure for MD5 (Message-Digest) computation */
42   typedef struct {
43     MD5UINT4  i[2];             /* number of _bits_ handled mod 2^64 */
44     MD5UINT4  buf[4];           /* scratch buffer */
45     unsigned char in[64];       /* input buffer */
46     unsigned char digest[16];   /* actual digest after MD5Final call */
47   } MD5_CTX;
48
49 /* ---------- Function Prototypes ------------- */
50
51 #ifdef WIN32
52 #ifdef BUILD_DLL
53 #define DLLINTERFACE __declspec(dllexport)
54 #else
55 #define DLLINTERFACE __declspec(dllimport)
56 #endif
57 #else
58 #define DLLINTERFACE
59 #endif
60
61 /* 
62  * utl_md5Init: initialize the context
63  *
64  * Parameters:
65  *
66  *   mdContext          pointer to context variable
67  *
68  * Return value:
69  *
70  *   none
71  *
72  * Note: The function initializes the message-digest context
73  *       mdContext. Call before each new use of the context - 
74  *       all fields are set to zero.
75  */
76   DLLINTERFACE void utl_md5Init(MD5_CTX * mdContext);
77
78
79 /*
80  * utl_md5update: update digest from variable length data
81  * 
82  * Parameters:
83  *
84  *   mdContext       pointer to context variable
85  *   inBuf           pointer to data array/string
86  *   inLen           length of data array/string
87  *
88  * Return value:
89  *
90  *   none
91  *
92  * Note: The function updates the message-digest context to account 
93  *       for the presence of each of the characters inBuf[0..inLen-1]
94  *       in the message whose digest is being computed.
95 */
96
97   DLLINTERFACE void utl_md5Update(MD5_CTX * mdContext, unsigned char *inBuf,
98                                  unsigned int inLen);
99
100
101 /*
102  * utl_md5Final: complete digest computation
103  *
104  * Parameters:
105  *
106  *   mdContext          pointer to context variable
107  *
108  * Return value:
109  *
110  *   none
111  *
112  * Note: The function terminates the message-digest computation and
113  *       ends with the desired message digest in mdContext.digest[0..15].
114  *       Always call before using the digest[] variable.
115 */
116
117   DLLINTERFACE void utl_md5Final(MD5_CTX * mdContext);
118
119
120 /* Ends C function definitions when using C++ */
121 #ifdef __cplusplus
122 };
123 #endif
124
125 #endif /* _utl_md5_h */