xref: /netbsd-src/crypto/external/bsd/openssl/dist/doc/man3/MDC2_Init.pod (revision b0d1725196a7921d003d2c66a14f186abda4176b)
113d40330Schristos=pod
213d40330Schristos
313d40330Schristos=head1 NAME
413d40330Schristos
513d40330SchristosMDC2, MDC2_Init, MDC2_Update, MDC2_Final - MDC2 hash function
613d40330Schristos
713d40330Schristos=head1 SYNOPSIS
813d40330Schristos
913d40330Schristos #include <openssl/mdc2.h>
1013d40330Schristos
11*b0d17251SchristosThe following functions have been deprecated since OpenSSL 3.0, and can be
12*b0d17251Schristoshidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value,
13*b0d17251Schristossee L<openssl_user_macros(7)>:
14*b0d17251Schristos
1513d40330Schristos unsigned char *MDC2(const unsigned char *d, unsigned long n,
1613d40330Schristos                     unsigned char *md);
1713d40330Schristos
1813d40330Schristos int MDC2_Init(MDC2_CTX *c);
1913d40330Schristos int MDC2_Update(MDC2_CTX *c, const unsigned char *data,
2013d40330Schristos                 unsigned long len);
2113d40330Schristos int MDC2_Final(unsigned char *md, MDC2_CTX *c);
2213d40330Schristos
2313d40330Schristos=head1 DESCRIPTION
2413d40330Schristos
25*b0d17251SchristosAll of the functions described on this page are deprecated.
26*b0d17251SchristosApplications should instead use L<EVP_DigestInit_ex(3)>, L<EVP_DigestUpdate(3)>
27*b0d17251Schristosand L<EVP_DigestFinal_ex(3)>.
28*b0d17251Schristos
2913d40330SchristosMDC2 is a method to construct hash functions with 128 bit output from
3013d40330Schristosblock ciphers.  These functions are an implementation of MDC2 with
3113d40330SchristosDES.
3213d40330Schristos
3313d40330SchristosMDC2() computes the MDC2 message digest of the B<n>
3413d40330Schristosbytes at B<d> and places it in B<md> (which must have space for
3513d40330SchristosMDC2_DIGEST_LENGTH == 16 bytes of output). If B<md> is NULL, the digest
3613d40330Schristosis placed in a static array.
3713d40330Schristos
3813d40330SchristosThe following functions may be used if the message is not completely
3913d40330Schristosstored in memory:
4013d40330Schristos
4113d40330SchristosMDC2_Init() initializes a B<MDC2_CTX> structure.
4213d40330Schristos
4313d40330SchristosMDC2_Update() can be called repeatedly with chunks of the message to
4413d40330Schristosbe hashed (B<len> bytes at B<data>).
4513d40330Schristos
4613d40330SchristosMDC2_Final() places the message digest in B<md>, which must have space
4713d40330Schristosfor MDC2_DIGEST_LENGTH == 16 bytes of output, and erases the B<MDC2_CTX>.
4813d40330Schristos
4913d40330SchristosApplications should use the higher level functions
5013d40330SchristosL<EVP_DigestInit(3)> etc. instead of calling the
5113d40330Schristoshash functions directly.
5213d40330Schristos
5313d40330Schristos=head1 RETURN VALUES
5413d40330Schristos
5513d40330SchristosMDC2() returns a pointer to the hash value.
5613d40330Schristos
5713d40330SchristosMDC2_Init(), MDC2_Update() and MDC2_Final() return 1 for success, 0 otherwise.
5813d40330Schristos
5913d40330Schristos=head1 CONFORMING TO
6013d40330Schristos
6113d40330SchristosISO/IEC 10118-2:2000 Hash-Function 2, with DES as the underlying block cipher.
6213d40330Schristos
6313d40330Schristos=head1 SEE ALSO
6413d40330Schristos
6513d40330SchristosL<EVP_DigestInit(3)>
6613d40330Schristos
67*b0d17251Schristos=head1 HISTORY
68*b0d17251Schristos
69*b0d17251SchristosAll of these functions were deprecated in OpenSSL 3.0.
70*b0d17251Schristos
7113d40330Schristos=head1 COPYRIGHT
7213d40330Schristos
73*b0d17251SchristosCopyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
7413d40330Schristos
75*b0d17251SchristosLicensed under the Apache License 2.0 (the "License").  You may not use
7613d40330Schristosthis file except in compliance with the License.  You can obtain a copy
7713d40330Schristosin the file LICENSE in the source distribution or at
7813d40330SchristosL<https://www.openssl.org/source/license.html>.
7913d40330Schristos
8013d40330Schristos=cut
81