xref: /openbsd-src/lib/libcrypto/man/RIPEMD160.3 (revision f6aab3d83b51b91c24247ad2c2573574de475a82)
1.\" $OpenBSD: RIPEMD160.3,v 1.7 2019/08/25 15:17:19 schwarze Exp $
2.\" full merge up to: OpenSSL 72a7a702 Feb 26 14:05:09 2019 +0000
3.\"
4.\" This file was written by Ulf Moeller <ulf@openssl.org>.
5.\" Copyright (c) 2000, 2006, 2014 The OpenSSL Project.  All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\"    notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in
16.\"    the documentation and/or other materials provided with the
17.\"    distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\"    software must display the following acknowledgment:
21.\"    "This product includes software developed by the OpenSSL Project
22.\"    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\"    endorse or promote products derived from this software without
26.\"    prior written permission. For written permission, please contact
27.\"    openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\"    nor may "OpenSSL" appear in their names without prior written
31.\"    permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\"    acknowledgment:
35.\"    "This product includes software developed by the OpenSSL Project
36.\"    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: August 25 2019 $
52.Dt RIPEMD160 3
53.Os
54.Sh NAME
55.Nm RIPEMD160 ,
56.Nm RIPEMD160_Init ,
57.Nm RIPEMD160_Update ,
58.Nm RIPEMD160_Final
59.Nd RIPEMD-160 hash function
60.Sh SYNOPSIS
61.In openssl/ripemd.h
62.Ft unsigned char *
63.Fo RIPEMD160
64.Fa "const unsigned char *d"
65.Fa "unsigned long n"
66.Fa "unsigned char *md"
67.Fc
68.Ft int
69.Fo RIPEMD160_Init
70.Fa "RIPEMD160_CTX *c"
71.Fc
72.Ft int
73.Fo RIPEMD160_Update
74.Fa "RIPEMD160_CTX *c"
75.Fa "const void *data"
76.Fa "unsigned long len"
77.Fc
78.Ft int
79.Fo RIPEMD160_Final
80.Fa "unsigned char *md"
81.Fa "RIPEMD160_CTX *c"
82.Fc
83.Sh DESCRIPTION
84RIPEMD-160 is a cryptographic hash function with a 160-bit output.
85.Pp
86.Fn RIPEMD160
87computes the RIPEMD-160 message digest of the
88.Fa n
89bytes at
90.Fa d
91and places it in
92.Fa md ,
93which must have space for
94.Dv RIPEMD160_DIGEST_LENGTH
95== 20 bytes of output.
96If
97.Fa md
98is
99.Dv NULL ,
100the digest is placed in a static array.
101.Pp
102The following functions may be used if the message is not completely
103stored in memory:
104.Pp
105.Fn RIPEMD160_Init
106initializes a
107.Vt RIPEMD160_CTX
108structure.
109.Pp
110.Fn RIPEMD160_Update
111can be called repeatedly with chunks of the message to be hashed
112.Pq Fa len No bytes at Fa data .
113.Pp
114.Fn RIPEMD160_Final
115places the message digest in
116.Fa md ,
117which must have space for
118.Dv RIPEMD160_DIGEST_LENGTH
119== 20 bytes of output,
120and erases the
121.Vt RIPEMD160_CTX .
122.Pp
123Applications should use the higher level functions
124.Xr EVP_DigestInit 3
125etc. instead of calling the hash functions directly.
126.Sh RETURN VALUES
127.Fn RIPEMD160
128returns a pointer to the hash value.
129.Pp
130.Fn RIPEMD160_Init ,
131.Fn RIPEMD160_Update ,
132and
133.Fn RIPEMD160_Final
134return 1 for success or 0 otherwise.
135.Sh SEE ALSO
136.Xr EVP_DigestInit 3 ,
137.Xr HMAC 3
138.Sh STANDARDS
139.Bd -unfilled
140ISO/IEC 10118-3:2004/Cor 1:2011
141Hash-functions \(em Part 3: Dedicated hash-functions
142Clause 7: RIPEMD-160
143.Ed
144.Sh HISTORY
145.Fn RIPEMD160 ,
146.Fn RIPEMD160_Init ,
147.Fn RIPEMD160_Update ,
148and
149.Fn RIPEMD160_Final
150first appeared in SSLeay 0.9.0 and have been available since
151.Ox 2.4 .
152