1=pod 2 3=head1 NAME 4 5MD2, MD4, MD5, MD2_Init, MD2_Update, MD2_Final, MD4_Init, MD4_Update, 6MD4_Final, MD5_Init, MD5_Update, MD5_Final - MD2, MD4, and MD5 hash functions 7 8=head1 SYNOPSIS 9 10 #include <openssl/md2.h> 11 12 unsigned char *MD2(const unsigned char *d, unsigned long n, unsigned char *md); 13 14 int MD2_Init(MD2_CTX *c); 15 int MD2_Update(MD2_CTX *c, const unsigned char *data, unsigned long len); 16 int MD2_Final(unsigned char *md, MD2_CTX *c); 17 18 19 #include <openssl/md4.h> 20 21 unsigned char *MD4(const unsigned char *d, unsigned long n, unsigned char *md); 22 23 int MD4_Init(MD4_CTX *c); 24 int MD4_Update(MD4_CTX *c, const void *data, unsigned long len); 25 int MD4_Final(unsigned char *md, MD4_CTX *c); 26 27 28 #include <openssl/md5.h> 29 30 unsigned char *MD5(const unsigned char *d, unsigned long n, unsigned char *md); 31 32 int MD5_Init(MD5_CTX *c); 33 int MD5_Update(MD5_CTX *c, const void *data, unsigned long len); 34 int MD5_Final(unsigned char *md, MD5_CTX *c); 35 36=head1 DESCRIPTION 37 38MD2, MD4, and MD5 are cryptographic hash functions with a 128 bit output. 39 40MD2(), MD4(), and MD5() compute the MD2, MD4, and MD5 message digest 41of the B<n> bytes at B<d> and place it in B<md> (which must have space 42for MD2_DIGEST_LENGTH == MD4_DIGEST_LENGTH == MD5_DIGEST_LENGTH == 16 43bytes of output). If B<md> is NULL, the digest is placed in a static 44array. 45 46The following functions may be used if the message is not completely 47stored in memory: 48 49MD2_Init() initializes a B<MD2_CTX> structure. 50 51MD2_Update() can be called repeatedly with chunks of the message to 52be hashed (B<len> bytes at B<data>). 53 54MD2_Final() places the message digest in B<md>, which must have space 55for MD2_DIGEST_LENGTH == 16 bytes of output, and erases the B<MD2_CTX>. 56 57MD4_Init(), MD4_Update(), MD4_Final(), MD5_Init(), MD5_Update(), and 58MD5_Final() are analogous using an B<MD4_CTX> and B<MD5_CTX> structure. 59 60Applications should use the higher level functions 61L<EVP_DigestInit(3)> 62etc. instead of calling the hash functions directly. 63 64=head1 NOTE 65 66MD2, MD4, and MD5 are recommended only for compatibility with existing 67applications. In new applications, SHA-1 or RIPEMD-160 should be 68preferred. 69 70=head1 RETURN VALUES 71 72MD2(), MD4(), and MD5() return pointers to the hash value. 73 74MD2_Init(), MD2_Update(), MD2_Final(), MD4_Init(), MD4_Update(), 75MD4_Final(), MD5_Init(), MD5_Update(), and MD5_Final() return 1 for 76success, 0 otherwise. 77 78=head1 CONFORMING TO 79 80RFC 1319, RFC 1320, RFC 1321 81 82=head1 SEE ALSO 83 84L<EVP_DigestInit(3)> 85 86=head1 COPYRIGHT 87 88Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. 89 90Licensed under the OpenSSL license (the "License"). You may not use 91this file except in compliance with the License. You can obtain a copy 92in the file LICENSE in the source distribution or at 93L<https://www.openssl.org/source/license.html>. 94 95=cut 96