MD4 implemented.  Assar Westerlund provided the digest code itself and the test utility, I added the bits to get a EVP interface, the command line utility and the speed test
diff --git a/util/libeay.num b/util/libeay.num
index 7ddce1a..5d5a3e0 100755
--- a/util/libeay.num
+++ b/util/libeay.num
@@ -1833,3 +1833,9 @@
 ASN1_STRING_print_ex_fp                 2430
 X509_NAME_print_ex                      2431
 ASN1_STRING_print_ex                    2432
+MD4                                     2433
+MD4_Transform                           2434
+MD4_Final                               2435
+MD4_Update                              2436
+MD4_Init                                2437
+EVP_md4                                 2438
diff --git a/util/mk1mf.pl b/util/mk1mf.pl
index 98ee587..72e47af 100755
--- a/util/mk1mf.pl
+++ b/util/mk1mf.pl
@@ -52,7 +52,8 @@
 		{ printf STDERR "\t%-10s\t%s\n",$i,$ops{$i}; }
 		print STDERR <<"EOF";
 and [options] can be one of
-	no-md2 no-md5 no-sha no-mdc2 no-ripemd  - Skip this digest
+	no-md2 no-md4 no-md5 no-sha no-mdc2	- Skip this digest
+	no-ripemd
 	no-rc2 no-rc4 no-idea no-des no-bf no-cast - Skip this symetric cipher
 	no-rc5
 	no-rsa no-dsa no-dh			- Skip this public key cipher
@@ -201,6 +202,7 @@
 $cflags.=" -DNO_RC4"  if $no_rc4;
 $cflags.=" -DNO_RC5"  if $no_rc5;
 $cflags.=" -DNO_MD2"  if $no_md2;
+$cflags.=" -DNO_MD4"  if $no_md4;
 $cflags.=" -DNO_MD5"  if $no_md5;
 $cflags.=" -DNO_SHA"  if $no_sha;
 $cflags.=" -DNO_SHA1" if $no_sha1;
@@ -666,6 +668,7 @@
 	@a=grep(!/(_sock$)|(_acpt$)|(_conn$)|(^pxy_)/,@a) if $no_sock;
 
 	@a=grep(!/(^md2)|(_md2$)/,@a) if $no_md2;
+	@a=grep(!/(^md4)|(_md4$)/,@a) if $no_md4;
 	@a=grep(!/(^md5)|(_md5$)/,@a) if $no_md5;
 	@a=grep(!/(rmd)|(ripemd)/,@a) if $no_rmd160;
 
@@ -855,6 +858,7 @@
 	elsif (/^no-bf$/)	{ $no_bf=1; }
 	elsif (/^no-cast$/)	{ $no_cast=1; }
 	elsif (/^no-md2$/)  	{ $no_md2=1; }
+	elsif (/^no-md4$/)	{ $no_md4=1; }
 	elsif (/^no-md5$/)	{ $no_md5=1; }
 	elsif (/^no-sha$/)	{ $no_sha=1; }
 	elsif (/^no-sha1$/)	{ $no_sha1=1; }
diff --git a/util/mkdef.pl b/util/mkdef.pl
index c7a0892..6078aec 100755
--- a/util/mkdef.pl
+++ b/util/mkdef.pl
@@ -31,7 +31,8 @@
 # defined with ifndef(NO_XXX) are not included in the .def file, and everything
 # in directory xxx is ignored.
 my $no_rc2; my $no_rc4; my $no_rc5; my $no_idea; my $no_des; my $no_bf;
-my $no_cast; my $no_md2; my $no_md5; my $no_sha; my $no_ripemd; my $no_mdc2;
+my $no_cast;
+my $no_md2; my $no_md4; my $no_md5; my $no_sha; my $no_ripemd; my $no_mdc2;
 my $no_rsa; my $no_dsa; my $no_dh; my $no_hmac=0;
 
 foreach (@ARGV, split(/ /, $options))
@@ -59,6 +60,7 @@
 	elsif (/^no-bf$/)       { $no_bf=1; }
 	elsif (/^no-cast$/)     { $no_cast=1; }
 	elsif (/^no-md2$/)      { $no_md2=1; }
+	elsif (/^no-md4$/)      { $no_md4=1; }
 	elsif (/^no-md5$/)      { $no_md5=1; }
 	elsif (/^no-sha$/)      { $no_sha=1; }
 	elsif (/^no-ripemd$/)   { $no_ripemd=1; }
@@ -92,6 +94,7 @@
 $crypto.=" crypto/bf/blowfish.h" unless $no_bf;
 $crypto.=" crypto/cast/cast.h" unless $no_cast;
 $crypto.=" crypto/md2/md2.h" unless $no_md2;
+$crypto.=" crypto/md4/md4.h" unless $no_md4;
 $crypto.=" crypto/md5/md5.h" unless $no_md5;
 $crypto.=" crypto/mdc2/mdc2.h" unless $no_mdc2;
 $crypto.=" crypto/sha/sha.h" unless $no_sha;
@@ -204,6 +207,7 @@
 			NO_BF		=> 0,
 			NO_CAST		=> 0,
 			NO_MD2		=> 0,
+			NO_MD4		=> 0,
 			NO_MD5		=> 0,
 			NO_SHA		=> 0,
 			NO_RIPEMD	=> 0,
@@ -322,6 +326,7 @@
 				($tag{'NO_BF'} == 0   || !$no_bf) &&
 				($tag{'NO_CAST'} == 0 || !$no_cast) &&
 				($tag{'NO_MD2'} == 0  || !$no_md2) &&
+				($tag{'NO_MD4'} == 0  || !$no_md4) &&
 				($tag{'NO_MD5'} == 0  || !$no_md5) &&
 				($tag{'NO_SHA'} == 0  || !$no_sha) &&
 				($tag{'NO_RIPEMD'} == 0 || !$no_ripemd) &&
@@ -351,6 +356,7 @@
 			next if(/EVP_dss/ and $no_dsa);
 			next if(/EVP_idea/ and $no_idea);
 			next if(/EVP_md2/ and $no_md2);
+			next if(/EVP_md4/ and $no_md4);
 			next if(/EVP_md5/ and $no_md5);
 			next if(/EVP_rc2/ and $no_rc2);
 			next if(/EVP_rc4/ and $no_rc4);
diff --git a/util/mkfiles.pl b/util/mkfiles.pl
index 924a85f..5296bdb 100755
--- a/util/mkfiles.pl
+++ b/util/mkfiles.pl
@@ -10,6 +10,7 @@
 ".",
 "crypto",
 "crypto/md2",
+"crypto/md4",
 "crypto/md5",
 "crypto/sha",
 "crypto/mdc2",
diff --git a/util/sp-diff.pl b/util/sp-diff.pl
index f81e502..9d6c603 100755
--- a/util/sp-diff.pl
+++ b/util/sp-diff.pl
@@ -11,7 +11,7 @@
 %two=&loadfile($ARGV[1]);
 
 $line=0;
-foreach $a ("md2","md5","sha","sha1","rc4","des cfb","des cbc","des ede3",
+foreach $a ("md2","md4","md5","sha","sha1","rc4","des cfb","des cbc","des ede3",
 	"idea cfb","idea cbc","rc2 cfb","rc2 cbc","blowfish cbc","cast cbc")
 	{
 	if (defined($one{$a,8}) && defined($two{$a,8}))