My Project
Main Page
Related Pages
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
SDL_test_md5.h
Go to the documentation of this file.
1
/*
2
Simple DirectMedia Layer
3
Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
4
5
This software is provided 'as-is', without any express or implied
6
warranty. In no event will the authors be held liable for any damages
7
arising from the use of this software.
8
9
Permission is granted to anyone to use this software for any purpose,
10
including commercial applications, and to alter it and redistribute it
11
freely, subject to the following restrictions:
12
13
1. The origin of this software must not be misrepresented; you must not
14
claim that you wrote the original software. If you use this software
15
in a product, an acknowledgment in the product documentation would be
16
appreciated but is not required.
17
2. Altered source versions must be plainly marked as such, and must not be
18
misrepresented as being the original software.
19
3. This notice may not be removed or altered from any source distribution.
20
*/
21
30
/*
31
***********************************************************************
32
** Header file for implementation of MD5 **
33
** RSA Data Security, Inc. MD5 Message-Digest Algorithm **
34
** Created: 2/17/90 RLR **
35
** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version **
36
** Revised (for MD5): RLR 4/27/91 **
37
** -- G modified to have y&~z instead of y&z **
38
** -- FF, GG, HH modified to add in last register done **
39
** -- Access pattern: round 2 works mod 5, round 3 works mod 3 **
40
** -- distinct additive constant for each step **
41
** -- round 4 added, working mod 7 **
42
***********************************************************************
43
*/
44
45
/*
46
***********************************************************************
47
** Message-digest routines: **
48
** To form the message digest for a message M **
49
** (1) Initialize a context buffer mdContext using MD5Init **
50
** (2) Call MD5Update on mdContext and M **
51
** (3) Call MD5Final on mdContext **
52
** The message digest is now in mdContext->digest[0...15] **
53
***********************************************************************
54
*/
55
56
#ifndef _SDL_test_md5_h
57
#define _SDL_test_md5_h
58
59
#include "
begin_code.h
"
60
/* Set up for C function definitions, even when using C++ */
61
#ifdef __cplusplus
62
extern
"C"
{
63
#endif
64
65
/* ------------ Definitions --------- */
66
67
/* typedef a 32-bit type */
68
typedef
unsigned
long
int
MD5UINT4;
69
70
/* Data structure for MD5 (Message-Digest) computation */
71
typedef
struct
{
72
MD5UINT4 i[2];
/* number of _bits_ handled mod 2^64 */
73
MD5UINT4 buf[4];
/* scratch buffer */
74
unsigned
char
in[64];
/* input buffer */
75
unsigned
char
digest[16];
/* actual digest after Md5Final call */
76
}
SDLTest_Md5Context
;
77
78
/* ---------- Function Prototypes ------------- */
79
89
void
SDLTest_Md5Init
(
SDLTest_Md5Context
* mdContext);
90
91
104
void
SDLTest_Md5Update
(
SDLTest_Md5Context
* mdContext,
unsigned
char
*inBuf,
105
unsigned
int
inLen);
106
107
108
/*
109
* /brief complete digest computation
110
*
111
* /param mdContext pointer to context variable
112
*
113
* Note: The function terminates the message-digest computation and
114
* ends with the desired message digest in mdContext.digest[0..15].
115
* Always call before using the digest[] variable.
116
*/
117
118
void
SDLTest_Md5Final(
SDLTest_Md5Context
* mdContext);
119
120
121
/* Ends C function definitions when using C++ */
122
#ifdef __cplusplus
123
}
124
#endif
125
#include "
close_code.h
"
126
127
#endif
/* _SDL_test_md5_h */
128
129
/* vi: set ts=4 sw=4 expandtab: */
SDLTest_Md5Update
void SDLTest_Md5Update(SDLTest_Md5Context *mdContext, unsigned char *inBuf, unsigned int inLen)
SDLTest_Md5Init
void SDLTest_Md5Init(SDLTest_Md5Context *mdContext)
begin_code.h
close_code.h
SDLTest_Md5Context
Definition:
SDL_test_md5.h:71
Generated on Fri Jan 3 2014 16:49:11 for My Project by
1.8.5