Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

mdfour.h File Reference

Go to the source code of this file.

Data Structures

struct  mdfour

Functions

void mdfour_begin (struct mdfour *md)
void mdfour_update (struct mdfour *md, unsigned char *in, int n)
void mdfour_result (struct mdfour *md, unsigned char *out)
void mdfour (unsigned char *out, unsigned char *in, int n)


Function Documentation

void mdfour_begin struct mdfour   md
 

Definition at line 105 of file mdfour.c.

References mdfour::A, mdfour::B, mdfour::C, mdfour::D, and mdfour::totalN.

Referenced by file_checksum(), file_checksum1(), get_checksum2(), mdfour(), and sum_init().

00106 {
00107         md->A = 0x67452301;
00108         md->B = 0xefcdab89;
00109         md->C = 0x98badcfe;
00110         md->D = 0x10325476;
00111         md->totalN = 0;
00112 }

void mdfour_update struct mdfour   md,
unsigned char *    in,
int    n
 

Definition at line 142 of file mdfour.c.

References copy64(), mdfour64(), mdfour_tail(), and mdfour::totalN.

Referenced by file_checksum(), file_checksum1(), get_checksum2(), mdfour(), sum_end(), and sum_update().

00143 {
00144         uint32 M[16];
00145 
00146         if (n == 0) mdfour_tail(in, n);
00147 
00148         m = md;
00149 
00150         while (n >= 64) {
00151                 copy64(M, in);
00152                 mdfour64(M);
00153                 in += 64;
00154                 n -= 64;
00155                 m->totalN += 64;
00156         }
00157 
00158         if (n) mdfour_tail(in, n);
00159 }

void mdfour_result struct mdfour   md,
unsigned char *    out
 

Definition at line 162 of file mdfour.c.

References mdfour::A, mdfour::B, mdfour::C, copy4(), and mdfour::D.

Referenced by file_checksum(), file_checksum1(), get_checksum2(), mdfour(), and sum_end().

00163 {
00164         m = md;
00165 
00166         copy4(out, m->A);
00167         copy4(out+4, m->B);
00168         copy4(out+8, m->C);
00169         copy4(out+12, m->D);
00170 }

void mdfour unsigned char *    out,
unsigned char *    in,
int    n
 

Definition at line 173 of file mdfour.c.

References mdfour_begin(), mdfour_result(), and mdfour_update().

00174 {
00175         struct mdfour md;
00176         mdfour_begin(&md);
00177         mdfour_update(&md, in, n);
00178         mdfour_result(&md, out);
00179 }


Generated on Tue Apr 16 12:37:39 2002 for rsync by doxygen1.2.15