Main Page | Class List | Directories | File List | Class Members | File Members

md4.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <openssl/md4.h>

Go to the source code of this file.

Defines

#define BUFSIZE   1024*16

Functions

void do_fp (FILE *f)
void pt (unsigned char *md)
int read (int, void *, unsigned int)
int main (int argc, char **argv)


Define Documentation

#define BUFSIZE   1024*16
 

Definition at line 63 of file md4.c.


Function Documentation

void do_fp FILE *  f  ) 
 

Definition at line 99 of file md4.c.

References BUFSIZE, c, md, MD4_DIGEST_LENGTH, MD4_Final(), MD4_Init(), MD4_Update(), pt(), and read().

00100         {
00101         MD4_CTX c;
00102         unsigned char md[MD4_DIGEST_LENGTH];
00103         int fd;
00104         int i;
00105         static unsigned char buf[BUFSIZE];
00106 
00107         fd=fileno(f);
00108         MD4_Init(&c);
00109         for (;;)
00110                 {
00111                 i=read(fd,buf,sizeof buf);
00112                 if (i <= 0) break;
00113                 MD4_Update(&c,buf,(unsigned long)i);
00114                 }
00115         MD4_Final(&(md[0]),&c);
00116         pt(md);
00117         }

int main int  argc,
char **  argv
 

Definition at line 71 of file md4.c.

References do_fp(), and exit().

00072         {
00073         int i,err=0;
00074         FILE *IN;
00075 
00076         if (argc == 1)
00077                 {
00078                 do_fp(stdin);
00079                 }
00080         else
00081                 {
00082                 for (i=1; i<argc; i++)
00083                         {
00084                         IN=fopen(argv[i],"r");
00085                         if (IN == NULL)
00086                                 {
00087                                 perror(argv[i]);
00088                                 err++;
00089                                 continue;
00090                                 }
00091                         printf("MD4(%s)= ",argv[i]);
00092                         do_fp(IN);
00093                         fclose(IN);
00094                         }
00095                 }
00096         exit(err);
00097         }

static char * pt unsigned char *  md  ) 
 

Definition at line 119 of file md4.c.

References MD4_DIGEST_LENGTH.

Referenced by cfb64_test(), cfb_test(), do_fp(), ede_cfb64_test(), main(), X509_check_purpose(), and X509_check_trust().

00120         {
00121         int i;
00122 
00123         for (i=0; i<MD4_DIGEST_LENGTH; i++)
00124                 printf("%02x",md[i]);
00125         printf("\n");
00126         }

int read int  ,
void *  ,
unsigned  int
 

Referenced by buffer_from_fd(), DES_enc_read(), do_cipher(), do_decode(), do_encode(), do_fp(), main(), main_decrypt(), main_encrypt(), RAND_poll(), RAND_query_egd_bytes(), read_attempt(), and sv_body().


© sourcejam.com 2005-2008