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