159191Skris=pod 259191Skris 359191Skris=head1 NAME 459191Skris 559191SkrisMDC2, MDC2_Init, MDC2_Update, MDC2_Final - MDC2 hash function 659191Skris 759191Skris=head1 SYNOPSIS 859191Skris 959191Skris #include <openssl/mdc2.h> 1059191Skris 1159191Skris unsigned char *MDC2(const unsigned char *d, unsigned long n, 1259191Skris unsigned char *md); 1359191Skris 14167612Ssimon int MDC2_Init(MDC2_CTX *c); 15167612Ssimon int MDC2_Update(MDC2_CTX *c, const unsigned char *data, 1659191Skris unsigned long len); 17167612Ssimon int MDC2_Final(unsigned char *md, MDC2_CTX *c); 1859191Skris 1959191Skris=head1 DESCRIPTION 2059191Skris 2159191SkrisMDC2 is a method to construct hash functions with 128 bit output from 2259191Skrisblock ciphers. These functions are an implementation of MDC2 with 2359191SkrisDES. 2459191Skris 2559191SkrisMDC2() computes the MDC2 message digest of the B<n> 2659191Skrisbytes at B<d> and places it in B<md> (which must have space for 2759191SkrisMDC2_DIGEST_LENGTH == 16 bytes of output). If B<md> is NULL, the digest 2859191Skrisis placed in a static array. 2959191Skris 3059191SkrisThe following functions may be used if the message is not completely 3159191Skrisstored in memory: 3259191Skris 3359191SkrisMDC2_Init() initializes a B<MDC2_CTX> structure. 3459191Skris 3559191SkrisMDC2_Update() can be called repeatedly with chunks of the message to 3659191Skrisbe hashed (B<len> bytes at B<data>). 3759191Skris 3859191SkrisMDC2_Final() places the message digest in B<md>, which must have space 3959191Skrisfor MDC2_DIGEST_LENGTH == 16 bytes of output, and erases the B<MDC2_CTX>. 4059191Skris 4159191SkrisApplications should use the higher level functions 4259191SkrisL<EVP_DigestInit(3)|EVP_DigestInit(3)> etc. instead of calling the 4359191Skrishash functions directly. 4459191Skris 4559191Skris=head1 RETURN VALUES 4659191Skris 4759191SkrisMDC2() returns a pointer to the hash value. 4859191Skris 49167612SsimonMDC2_Init(), MDC2_Update() and MDC2_Final() return 1 for success, 0 otherwise. 5059191Skris 5159191Skris=head1 CONFORMING TO 5259191Skris 5359191SkrisISO/IEC 10118-2, with DES 5459191Skris 5559191Skris=head1 SEE ALSO 5659191Skris 5759191SkrisL<sha(3)|sha(3)>, L<EVP_DigestInit(3)|EVP_DigestInit(3)> 5859191Skris 5959191Skris=head1 HISTORY 6059191Skris 6159191SkrisMDC2(), MDC2_Init(), MDC2_Update() and MDC2_Final() are available since 6259191SkrisSSLeay 0.8. 6359191Skris 6459191Skris=cut 65