]>
Commit | Line | Data |
---|---|---|
9dbc41d7 UM |
1 | =pod |
2 | ||
3 | =head1 NAME | |
4 | ||
5 | MDC2, MDC2_Init, MDC2_Update, MDC2_Final - MDC2 hash function | |
6 | ||
7 | =head1 SYNOPSIS | |
8 | ||
9 | #include <openssl/mdc2.h> | |
10 | ||
11 | unsigned char *MDC2(const unsigned char *d, unsigned long n, | |
e9b77246 | 12 | unsigned char *md); |
9dbc41d7 | 13 | |
8a4af56f NL |
14 | int MDC2_Init(MDC2_CTX *c); |
15 | int MDC2_Update(MDC2_CTX *c, const unsigned char *data, | |
e9b77246 | 16 | unsigned long len); |
8a4af56f | 17 | int MDC2_Final(unsigned char *md, MDC2_CTX *c); |
9dbc41d7 UM |
18 | |
19 | =head1 DESCRIPTION | |
20 | ||
21 | MDC2 is a method to construct hash functions with 128 bit output from | |
22 | block ciphers. These functions are an implementation of MDC2 with | |
23 | DES. | |
24 | ||
25 | MDC2() computes the MDC2 message digest of the B<n> | |
26 | bytes at B<d> and places it in B<md> (which must have space for | |
27 | MDC2_DIGEST_LENGTH == 16 bytes of output). If B<md> is NULL, the digest | |
28 | is placed in a static array. | |
29 | ||
30 | The following functions may be used if the message is not completely | |
31 | stored in memory: | |
32 | ||
33 | MDC2_Init() initializes a B<MDC2_CTX> structure. | |
34 | ||
35 | MDC2_Update() can be called repeatedly with chunks of the message to | |
36 | be hashed (B<len> bytes at B<data>). | |
37 | ||
38 | MDC2_Final() places the message digest in B<md>, which must have space | |
39 | for MDC2_DIGEST_LENGTH == 16 bytes of output, and erases the B<MDC2_CTX>. | |
40 | ||
d52c9734 | 41 | Applications should use the higher level functions |
9b86974e | 42 | L<EVP_DigestInit(3)> etc. instead of calling the |
d52c9734 UM |
43 | hash functions directly. |
44 | ||
9dbc41d7 UM |
45 | =head1 RETURN VALUES |
46 | ||
1bc74519 | 47 | MDC2() returns a pointer to the hash value. |
9dbc41d7 | 48 | |
8a4af56f | 49 | MDC2_Init(), MDC2_Update() and MDC2_Final() return 1 for success, 0 otherwise. |
9dbc41d7 UM |
50 | |
51 | =head1 CONFORMING TO | |
52 | ||
bbda8ce9 | 53 | ISO/IEC 10118-2:2000 Hash-Function 2, with DES as the underlying block cipher. |
9dbc41d7 UM |
54 | |
55 | =head1 SEE ALSO | |
56 | ||
9b86974e | 57 | L<EVP_DigestInit(3)> |
9dbc41d7 | 58 | |
e2f92610 RS |
59 | =head1 COPYRIGHT |
60 | ||
bbda8ce9 | 61 | Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved. |
e2f92610 | 62 | |
4746f25a | 63 | Licensed under the Apache License 2.0 (the "License"). You may not use |
e2f92610 RS |
64 | this file except in compliance with the License. You can obtain a copy |
65 | in the file LICENSE in the source distribution or at | |
66 | L<https://www.openssl.org/source/license.html>. | |
67 | ||
68 | =cut |