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