ReactOS 0.4.15-dev-7924-g5949c20
md5.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  MD5_CTX
 

Typedefs

typedef unsigned int MD5_u32plus
 

Functions

void MD5_Init (MD5_CTX *ctx)
 
void MD5_Update (MD5_CTX *ctx, const void *data, unsigned long size)
 
void MD5_Final (unsigned char *result, MD5_CTX *ctx)
 

Typedef Documentation

◆ MD5_u32plus

Definition at line 32 of file md5.h.

Function Documentation

◆ MD5_Final()

void MD5_Final ( unsigned char result,
MD5_CTX ctx 
)

Definition at line 258 of file md5.c.

259{
260 unsigned long used, available;
261
262 used = ctx->lo & 0x3f;
263
264 ctx->buffer[used++] = 0x80;
265
266 available = 64 - used;
267
268 if (available < 8) {
269 memset(&ctx->buffer[used], 0, available);
270 body(ctx, ctx->buffer, 64);
271 used = 0;
272 available = 64;
273 }
274
275 memset(&ctx->buffer[used], 0, available - 8);
276
277 ctx->lo <<= 3;
278 OUT(&ctx->buffer[56], ctx->lo)
279 OUT(&ctx->buffer[60], ctx->hi)
280
281 body(ctx, ctx->buffer, 64);
282
283 OUT(&result[0], ctx->a)
284 OUT(&result[4], ctx->b)
285 OUT(&result[8], ctx->c)
286 OUT(&result[12], ctx->d)
287
288 memset(ctx, 0, sizeof(*ctx));
289}
static int used
Definition: adh-main.c:39
static WCHAR available[MAX_STRING_RESOURCE_LEN]
Definition: object.c:2336
GLuint buffer
Definition: glext.h:5915
const GLubyte * c
Definition: glext.h:8905
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
GLuint64EXT * result
Definition: glext.h:11304
#define d
Definition: ke_i.h:81
static const void * body(MD5_CTX *ctx, const void *data, unsigned long size)
Definition: md5.c:100
#define OUT(dst, src)
Definition: md5.c:252
#define memset(x, y, z)
Definition: compat.h:39
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList

Referenced by FT_Render_Glyph_Internal(), generate_random(), sec_hash_16(), sec_hash_48(), sec_sign(), and sec_update().

◆ MD5_Init()

void MD5_Init ( MD5_CTX ctx)

Definition at line 207 of file md5.c.

208{
209 ctx->a = 0x67452301;
210 ctx->b = 0xefcdab89;
211 ctx->c = 0x98badcfe;
212 ctx->d = 0x10325476;
213
214 ctx->lo = 0;
215 ctx->hi = 0;
216}

Referenced by FT_Render_Glyph_Internal(), generate_random(), sec_hash_16(), sec_hash_48(), sec_sign(), and sec_update().

◆ MD5_Update()

void MD5_Update ( MD5_CTX ctx,
const void data,
unsigned long  size 
)

Definition at line 218 of file md5.c.

219{
220 MD5_u32plus saved_lo;
221 unsigned long used, available;
222
223 saved_lo = ctx->lo;
224 if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo)
225 ctx->hi++;
226 ctx->hi += size >> 29;
227
228 used = saved_lo & 0x3f;
229
230 if (used) {
231 available = 64 - used;
232
233 if (size < available) {
234 memcpy(&ctx->buffer[used], data, size);
235 return;
236 }
237
238 memcpy(&ctx->buffer[used], data, available);
239 data = (const unsigned char *)data + available;
240 size -= available;
241 body(ctx, ctx->buffer, 64);
242 }
243
244 if (size >= 64) {
245 data = body(ctx, data, size & ~(unsigned long)0x3f);
246 size &= 0x3f;
247 }
248
249 memcpy(ctx->buffer, data, size);
250}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned int MD5_u32plus
Definition: md5.h:32

Referenced by FT_Render_Glyph_Internal(), generate_random(), sec_hash_16(), sec_hash_48(), sec_sign(), and sec_update().