xref: /freebsd/crypto/openssl/doc/man3/MDC2_Init.pod (revision 9f23cbd6cae82fd77edfad7173432fa8dccd0a95)
1=pod
2
3=head1 NAME
4
5MDC2, MDC2_Init, MDC2_Update, MDC2_Final - MDC2 hash function
6
7=head1 SYNOPSIS
8
9 #include <openssl/mdc2.h>
10
11The following functions have been deprecated since OpenSSL 3.0, and can be
12hidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value,
13see L<openssl_user_macros(7)>:
14
15 unsigned char *MDC2(const unsigned char *d, unsigned long n,
16                     unsigned char *md);
17
18 int MDC2_Init(MDC2_CTX *c);
19 int MDC2_Update(MDC2_CTX *c, const unsigned char *data,
20                 unsigned long len);
21 int MDC2_Final(unsigned char *md, MDC2_CTX *c);
22
23=head1 DESCRIPTION
24
25All of the functions described on this page are deprecated.
26Applications should instead use L<EVP_DigestInit_ex(3)>, L<EVP_DigestUpdate(3)>
27and L<EVP_DigestFinal_ex(3)>.
28
29MDC2 is a method to construct hash functions with 128 bit output from
30block ciphers.  These functions are an implementation of MDC2 with
31DES.
32
33MDC2() computes the MDC2 message digest of the B<n>
34bytes at B<d> and places it in B<md> (which must have space for
35MDC2_DIGEST_LENGTH == 16 bytes of output). If B<md> is NULL, the digest
36is placed in a static array.
37
38The following functions may be used if the message is not completely
39stored in memory:
40
41MDC2_Init() initializes a B<MDC2_CTX> structure.
42
43MDC2_Update() can be called repeatedly with chunks of the message to
44be hashed (B<len> bytes at B<data>).
45
46MDC2_Final() places the message digest in B<md>, which must have space
47for MDC2_DIGEST_LENGTH == 16 bytes of output, and erases the B<MDC2_CTX>.
48
49Applications should use the higher level functions
50L<EVP_DigestInit(3)> etc. instead of calling the
51hash functions directly.
52
53=head1 RETURN VALUES
54
55MDC2() returns a pointer to the hash value.
56
57MDC2_Init(), MDC2_Update() and MDC2_Final() return 1 for success, 0 otherwise.
58
59=head1 CONFORMING TO
60
61ISO/IEC 10118-2:2000 Hash-Function 2, with DES as the underlying block cipher.
62
63=head1 SEE ALSO
64
65L<EVP_DigestInit(3)>
66
67=head1 HISTORY
68
69All of these functions were deprecated in OpenSSL 3.0.
70
71=head1 COPYRIGHT
72
73Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
74
75Licensed under the Apache License 2.0 (the "License").  You may not use
76this file except in compliance with the License.  You can obtain a copy
77in the file LICENSE in the source distribution or at
78L<https://www.openssl.org/source/license.html>.
79
80=cut
81