md5.c File Reference

#include <string.h>
#include <stdio.h>
#include "md5.h"

Include dependency graph for md5.c:

Go to the source code of this file.

Defines

#define _CRT_SECURE_NO_DEPRECATE   1
#define GET_UINT32_LE(n, b, i)
#define PUT_UINT32_LE(n, b, i)
#define S(x, n)   ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n)))
#define P(a, b, c, d, k, s, t)
#define F(x, y, z)   (z ^ (x & (y ^ z)))
#define F(x, y, z)   (y ^ (z & (x ^ y)))
#define F(x, y, z)   (x ^ y ^ z)
#define F(x, y, z)   (y ^ (x | ~z))

Functions

void md5 (unsigned char *input, int ilen, unsigned char *output)
int md5_file (const char *path, unsigned char *output)


Define Documentation

#define _CRT_SECURE_NO_DEPRECATE   1

Definition at line 41 of file md5.c.

#define F ( x,
y,
 )     (y ^ (x | ~z))

#define F ( x,
y,
 )     (x ^ y ^ z)

#define F ( x,
y,
 )     (y ^ (z & (x ^ y)))

#define F ( x,
y,
 )     (z ^ (x & (y ^ z)))

#define GET_UINT32_LE ( n,
b,
 ) 

Value:

{                                                       \
    (n) = ( (unsigned long) (b)[(i)    ]       )        \
        | ( (unsigned long) (b)[(i) + 1] <<  8 )        \
        | ( (unsigned long) (b)[(i) + 2] << 16 )        \
        | ( (unsigned long) (b)[(i) + 3] << 24 );       \
}

Definition at line 53 of file md5.c.

#define P ( a,
b,
c,
d,
k,
s,
 ) 

Value:

{                                                       \
    a += F(b,c,d) + X[k] + t; a = S(a,s) + b;           \
}

#define PUT_UINT32_LE ( n,
b,
 ) 

Value:

{                                                       \
    (b)[(i)    ] = (unsigned char) ( (n)       );       \
    (b)[(i) + 1] = (unsigned char) ( (n) >>  8 );       \
    (b)[(i) + 2] = (unsigned char) ( (n) >> 16 );       \
    (b)[(i) + 3] = (unsigned char) ( (n) >> 24 );       \
}

Definition at line 63 of file md5.c.

#define S ( x,
 )     ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n)))


Function Documentation

void md5 ( unsigned char *  input,
int  ilen,
unsigned char *  output 
)

Definition at line 292 of file md5.c.

int md5_file ( const char *  path,
unsigned char *  output 
)

Definition at line 307 of file md5.c.

Referenced by alpm_get_md5sum().

Here is the caller graph for this function:


Generated on Mon Jan 14 23:57:32 2008 for libalpm by  doxygen 1.5.4