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