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