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