blob: 2795868073748f707d7342e0e452c1da019df2a4 [file] [log] [blame]
Ulf Möller9dbc41d2000-02-03 18:22:01 +00001=pod
2
3=head1 NAME
4
5MDC2, MDC2_Init, MDC2_Update, MDC2_Final - MDC2 hash function
6
7=head1 SYNOPSIS
8
9 #include <openssl/mdc2.h>
10
11 unsigned char *MDC2(const unsigned char *d, unsigned long n,
12 unsigned char *md);
13
Nils Larsch8a4af562006-10-27 21:58:09 +000014 int MDC2_Init(MDC2_CTX *c);
15 int MDC2_Update(MDC2_CTX *c, const unsigned char *data,
Ulf Möller9dbc41d2000-02-03 18:22:01 +000016 unsigned long len);
Nils Larsch8a4af562006-10-27 21:58:09 +000017 int MDC2_Final(unsigned char *md, MDC2_CTX *c);
Ulf Möller9dbc41d2000-02-03 18:22:01 +000018
19=head1 DESCRIPTION
20
21MDC2 is a method to construct hash functions with 128 bit output from
22block ciphers. These functions are an implementation of MDC2 with
23DES.
24
25MDC2() computes the MDC2 message digest of the B<n>
26bytes at B<d> and places it in B<md> (which must have space for
27MDC2_DIGEST_LENGTH == 16 bytes of output). If B<md> is NULL, the digest
28is placed in a static array.
29
30The following functions may be used if the message is not completely
31stored in memory:
32
33MDC2_Init() initializes a B<MDC2_CTX> structure.
34
35MDC2_Update() can be called repeatedly with chunks of the message to
36be hashed (B<len> bytes at B<data>).
37
38MDC2_Final() places the message digest in B<md>, which must have space
39for MDC2_DIGEST_LENGTH == 16 bytes of output, and erases the B<MDC2_CTX>.
40
Ulf Möllerd52c9732000-02-25 16:00:24 +000041Applications should use the higher level functions
42L<EVP_DigestInit(3)|EVP_DigestInit(3)> etc. instead of calling the
43hash functions directly.
44
Ulf Möller9dbc41d2000-02-03 18:22:01 +000045=head1 RETURN VALUES
46
47MDC2() returns a pointer to the hash value.
48
Nils Larsch8a4af562006-10-27 21:58:09 +000049MDC2_Init(), MDC2_Update() and MDC2_Final() return 1 for success, 0 otherwise.
Ulf Möller9dbc41d2000-02-03 18:22:01 +000050
51=head1 CONFORMING TO
52
53ISO/IEC 10118-2, with DES
54
55=head1 SEE ALSO
56
Rich Salzc7497f32014-08-14 10:50:26 -040057L<EVP_DigestInit(3)|EVP_DigestInit(3)>
Ulf Möller9dbc41d2000-02-03 18:22:01 +000058
59=cut