1*2175Sjp161948=pod 2*2175Sjp161948 3*2175Sjp161948=head1 NAME 4*2175Sjp161948 5*2175Sjp161948MDC2, MDC2_Init, MDC2_Update, MDC2_Final - MDC2 hash function 6*2175Sjp161948 7*2175Sjp161948=head1 SYNOPSIS 8*2175Sjp161948 9*2175Sjp161948 #include <openssl/mdc2.h> 10*2175Sjp161948 11*2175Sjp161948 unsigned char *MDC2(const unsigned char *d, unsigned long n, 12*2175Sjp161948 unsigned char *md); 13*2175Sjp161948 14*2175Sjp161948 void MDC2_Init(MDC2_CTX *c); 15*2175Sjp161948 void MDC2_Update(MDC2_CTX *c, const unsigned char *data, 16*2175Sjp161948 unsigned long len); 17*2175Sjp161948 void MDC2_Final(unsigned char *md, MDC2_CTX *c); 18*2175Sjp161948 19*2175Sjp161948=head1 DESCRIPTION 20*2175Sjp161948 21*2175Sjp161948MDC2 is a method to construct hash functions with 128 bit output from 22*2175Sjp161948block ciphers. These functions are an implementation of MDC2 with 23*2175Sjp161948DES. 24*2175Sjp161948 25*2175Sjp161948MDC2() computes the MDC2 message digest of the B<n> 26*2175Sjp161948bytes at B<d> and places it in B<md> (which must have space for 27*2175Sjp161948MDC2_DIGEST_LENGTH == 16 bytes of output). If B<md> is NULL, the digest 28*2175Sjp161948is placed in a static array. 29*2175Sjp161948 30*2175Sjp161948The following functions may be used if the message is not completely 31*2175Sjp161948stored in memory: 32*2175Sjp161948 33*2175Sjp161948MDC2_Init() initializes a B<MDC2_CTX> structure. 34*2175Sjp161948 35*2175Sjp161948MDC2_Update() can be called repeatedly with chunks of the message to 36*2175Sjp161948be hashed (B<len> bytes at B<data>). 37*2175Sjp161948 38*2175Sjp161948MDC2_Final() places the message digest in B<md>, which must have space 39*2175Sjp161948for MDC2_DIGEST_LENGTH == 16 bytes of output, and erases the B<MDC2_CTX>. 40*2175Sjp161948 41*2175Sjp161948Applications should use the higher level functions 42*2175Sjp161948L<EVP_DigestInit(3)|EVP_DigestInit(3)> etc. instead of calling the 43*2175Sjp161948hash functions directly. 44*2175Sjp161948 45*2175Sjp161948=head1 RETURN VALUES 46*2175Sjp161948 47*2175Sjp161948MDC2() returns a pointer to the hash value. 48*2175Sjp161948 49*2175Sjp161948MDC2_Init(), MDC2_Update() and MDC2_Final() do not return values. 50*2175Sjp161948 51*2175Sjp161948=head1 CONFORMING TO 52*2175Sjp161948 53*2175Sjp161948ISO/IEC 10118-2, with DES 54*2175Sjp161948 55*2175Sjp161948=head1 SEE ALSO 56*2175Sjp161948 57*2175Sjp161948L<sha(3)|sha(3)>, L<EVP_DigestInit(3)|EVP_DigestInit(3)> 58*2175Sjp161948 59*2175Sjp161948=head1 HISTORY 60*2175Sjp161948 61*2175Sjp161948MDC2(), MDC2_Init(), MDC2_Update() and MDC2_Final() are available since 62*2175Sjp161948SSLeay 0.8. 63*2175Sjp161948 64*2175Sjp161948=cut 65