xref: /netbsd-src/crypto/external/bsd/openssl.old/dist/doc/man3/MDC2_Init.pod (revision 4724848cf0da353df257f730694b7882798e5daf)
1*4724848cSchristos=pod
2*4724848cSchristos
3*4724848cSchristos=head1 NAME
4*4724848cSchristos
5*4724848cSchristosMDC2, MDC2_Init, MDC2_Update, MDC2_Final - MDC2 hash function
6*4724848cSchristos
7*4724848cSchristos=head1 SYNOPSIS
8*4724848cSchristos
9*4724848cSchristos #include <openssl/mdc2.h>
10*4724848cSchristos
11*4724848cSchristos unsigned char *MDC2(const unsigned char *d, unsigned long n,
12*4724848cSchristos                     unsigned char *md);
13*4724848cSchristos
14*4724848cSchristos int MDC2_Init(MDC2_CTX *c);
15*4724848cSchristos int MDC2_Update(MDC2_CTX *c, const unsigned char *data,
16*4724848cSchristos                 unsigned long len);
17*4724848cSchristos int MDC2_Final(unsigned char *md, MDC2_CTX *c);
18*4724848cSchristos
19*4724848cSchristos=head1 DESCRIPTION
20*4724848cSchristos
21*4724848cSchristosMDC2 is a method to construct hash functions with 128 bit output from
22*4724848cSchristosblock ciphers.  These functions are an implementation of MDC2 with
23*4724848cSchristosDES.
24*4724848cSchristos
25*4724848cSchristosMDC2() computes the MDC2 message digest of the B<n>
26*4724848cSchristosbytes at B<d> and places it in B<md> (which must have space for
27*4724848cSchristosMDC2_DIGEST_LENGTH == 16 bytes of output). If B<md> is NULL, the digest
28*4724848cSchristosis placed in a static array.
29*4724848cSchristos
30*4724848cSchristosThe following functions may be used if the message is not completely
31*4724848cSchristosstored in memory:
32*4724848cSchristos
33*4724848cSchristosMDC2_Init() initializes a B<MDC2_CTX> structure.
34*4724848cSchristos
35*4724848cSchristosMDC2_Update() can be called repeatedly with chunks of the message to
36*4724848cSchristosbe hashed (B<len> bytes at B<data>).
37*4724848cSchristos
38*4724848cSchristosMDC2_Final() places the message digest in B<md>, which must have space
39*4724848cSchristosfor MDC2_DIGEST_LENGTH == 16 bytes of output, and erases the B<MDC2_CTX>.
40*4724848cSchristos
41*4724848cSchristosApplications should use the higher level functions
42*4724848cSchristosL<EVP_DigestInit(3)> etc. instead of calling the
43*4724848cSchristoshash functions directly.
44*4724848cSchristos
45*4724848cSchristos=head1 RETURN VALUES
46*4724848cSchristos
47*4724848cSchristosMDC2() returns a pointer to the hash value.
48*4724848cSchristos
49*4724848cSchristosMDC2_Init(), MDC2_Update() and MDC2_Final() return 1 for success, 0 otherwise.
50*4724848cSchristos
51*4724848cSchristos=head1 CONFORMING TO
52*4724848cSchristos
53*4724848cSchristosISO/IEC 10118-2:2000 Hash-Function 2, with DES as the underlying block cipher.
54*4724848cSchristos
55*4724848cSchristos=head1 SEE ALSO
56*4724848cSchristos
57*4724848cSchristosL<EVP_DigestInit(3)>
58*4724848cSchristos
59*4724848cSchristos=head1 COPYRIGHT
60*4724848cSchristos
61*4724848cSchristosCopyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved.
62*4724848cSchristos
63*4724848cSchristosLicensed under the OpenSSL license (the "License").  You may not use
64*4724848cSchristosthis file except in compliance with the License.  You can obtain a copy
65*4724848cSchristosin the file LICENSE in the source distribution or at
66*4724848cSchristosL<https://www.openssl.org/source/license.html>.
67*4724848cSchristos
68*4724848cSchristos=cut
69