159191Skris=pod 259191Skris 359191Skris=head1 NAME 459191Skris 568651SkrisMD2, MD4, MD5, MD2_Init, MD2_Update, MD2_Final, MD4_Init, MD4_Update, 668651SkrisMD4_Final, MD5_Init, MD5_Update, MD5_Final - MD2, MD4, and MD5 hash functions 759191Skris 859191Skris=head1 SYNOPSIS 959191Skris 1059191Skris #include <openssl/md2.h> 1159191Skris 1259191Skris unsigned char *MD2(const unsigned char *d, unsigned long n, 1359191Skris unsigned char *md); 1459191Skris 15167612Ssimon int MD2_Init(MD2_CTX *c); 16167612Ssimon int MD2_Update(MD2_CTX *c, const unsigned char *data, 1759191Skris unsigned long len); 18167612Ssimon int MD2_Final(unsigned char *md, MD2_CTX *c); 1959191Skris 2059191Skris 2168651Skris #include <openssl/md4.h> 2268651Skris 2368651Skris unsigned char *MD4(const unsigned char *d, unsigned long n, 2468651Skris unsigned char *md); 2568651Skris 26167612Ssimon int MD4_Init(MD4_CTX *c); 27167612Ssimon int MD4_Update(MD4_CTX *c, const void *data, 2868651Skris unsigned long len); 29167612Ssimon int MD4_Final(unsigned char *md, MD4_CTX *c); 3068651Skris 3168651Skris 3259191Skris #include <openssl/md5.h> 3359191Skris 3459191Skris unsigned char *MD5(const unsigned char *d, unsigned long n, 3559191Skris unsigned char *md); 3659191Skris 37167612Ssimon int MD5_Init(MD5_CTX *c); 38167612Ssimon int MD5_Update(MD5_CTX *c, const void *data, 3959191Skris unsigned long len); 40167612Ssimon int MD5_Final(unsigned char *md, MD5_CTX *c); 4159191Skris 4259191Skris=head1 DESCRIPTION 4359191Skris 4468651SkrisMD2, MD4, and MD5 are cryptographic hash functions with a 128 bit output. 4559191Skris 4668651SkrisMD2(), MD4(), and MD5() compute the MD2, MD4, and MD5 message digest 4768651Skrisof the B<n> bytes at B<d> and place it in B<md> (which must have space 4868651Skrisfor MD2_DIGEST_LENGTH == MD4_DIGEST_LENGTH == MD5_DIGEST_LENGTH == 16 4968651Skrisbytes of output). If B<md> is NULL, the digest is placed in a static 5068651Skrisarray. 5159191Skris 5259191SkrisThe following functions may be used if the message is not completely 5359191Skrisstored in memory: 5459191Skris 5559191SkrisMD2_Init() initializes a B<MD2_CTX> structure. 5659191Skris 5759191SkrisMD2_Update() can be called repeatedly with chunks of the message to 5859191Skrisbe hashed (B<len> bytes at B<data>). 5959191Skris 6059191SkrisMD2_Final() places the message digest in B<md>, which must have space 6159191Skrisfor MD2_DIGEST_LENGTH == 16 bytes of output, and erases the B<MD2_CTX>. 6259191Skris 6368651SkrisMD4_Init(), MD4_Update(), MD4_Final(), MD5_Init(), MD5_Update(), and 6468651SkrisMD5_Final() are analogous using an B<MD4_CTX> and B<MD5_CTX> structure. 6559191Skris 6659191SkrisApplications should use the higher level functions 6759191SkrisL<EVP_DigestInit(3)|EVP_DigestInit(3)> 6859191Skrisetc. instead of calling the hash functions directly. 6959191Skris 7059191Skris=head1 NOTE 7159191Skris 7268651SkrisMD2, MD4, and MD5 are recommended only for compatibility with existing 7359191Skrisapplications. In new applications, SHA-1 or RIPEMD-160 should be 7459191Skrispreferred. 7559191Skris 7659191Skris=head1 RETURN VALUES 7759191Skris 7868651SkrisMD2(), MD4(), and MD5() return pointers to the hash value. 7959191Skris 8068651SkrisMD2_Init(), MD2_Update(), MD2_Final(), MD4_Init(), MD4_Update(), 81167612SsimonMD4_Final(), MD5_Init(), MD5_Update(), and MD5_Final() return 1 for 82167612Ssimonsuccess, 0 otherwise. 8359191Skris 8459191Skris=head1 CONFORMING TO 8559191Skris 8668651SkrisRFC 1319, RFC 1320, RFC 1321 8759191Skris 8859191Skris=head1 SEE ALSO 8959191Skris 9059191SkrisL<sha(3)|sha(3)>, L<ripemd(3)|ripemd(3)>, L<EVP_DigestInit(3)|EVP_DigestInit(3)> 9159191Skris 9259191Skris=head1 HISTORY 9359191Skris 9459191SkrisMD2(), MD2_Init(), MD2_Update() MD2_Final(), MD5(), MD5_Init(), 9559191SkrisMD5_Update() and MD5_Final() are available in all versions of SSLeay 9659191Skrisand OpenSSL. 9759191Skris 9868651SkrisMD4(), MD4_Init(), and MD4_Update() are available in OpenSSL 0.9.6 and 9968651Skrisabove. 10068651Skris 10159191Skris=cut 102