2 .\" ----------------------------------------------------------------------------
3 .\" "THE BEER-WARE LICENSE" (Revision 42):
4 .\" <phk@FreeBSD.org> wrote this file. As long as you retain this notice you
5 .\" can do whatever you want with this stuff. If we meet some day, and you think
6 .\" this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
7 .\" ----------------------------------------------------------------------------
9 .\" From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp
10 .\" $FreeBSD: src/lib/libmd/ripemd.3,v 1.15 2005/02/13 22:25:13 ru Exp $
11 .\" $DragonFly: src/lib/libmd/ripemd.3,v 1.4 2008/09/11 20:25:34 swildner Exp $
18 .Nm RIPEMD160_Update ,
22 .Nm RIPEMD160_FileChunk ,
24 .Nd calculate the RIPEMD160 message digest
31 .Fn RIPEMD160_Init "RIPEMD160_CTX *context"
33 .Fn RIPEMD160_Update "RIPEMD160_CTX *context" "const unsigned char *data" "unsigned int len"
35 .Fn RIPEMD160_Final "unsigned char digest[20]" "RIPEMD160_CTX *context"
37 .Fn RIPEMD160_End "RIPEMD160_CTX *context" "char *buf"
39 .Fn RIPEMD160_File "const char *filename" "char *buf"
41 .Fn RIPEMD160_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length"
43 .Fn RIPEMD160_Data "const unsigned char *data" "unsigned int len" "char *buf"
47 functions calculate a 160-bit cryptographic checksum (digest)
48 for any number of input bytes.
49 A cryptographic checksum is a one-way
50 hash function; that is, it is computationally impractical to find
51 the input corresponding to a particular output.
54 of the input-data, which does not disclose the actual input.
58 .Fn RIPEMD160_Update ,
61 functions are the core functions.
66 run over the data with
67 .Fn RIPEMD160_Update ,
68 and finally extract the result using
73 function is a wrapper for
75 which converts the return value to a 41-character
76 (including the terminating '\e0')
78 string which represents the 160 bits in hexadecimal.
82 function calculates the digest of a file, and uses
85 If the file cannot be opened, a null pointer is returned.
87 .Fn RIPEMD160_FileChunk
88 function is similar to
90 but it only calculates the digest over a byte-range of the file specified,
98 parameter is specified as 0, or more than the length of the remaining part
100 .Fn RIPEMD160_FileChunk
101 calculates the digest from
106 function calculates the digest of a chunk of data in memory, and uses
108 to return the result.
117 argument can be a null pointer, in which case the returned string
120 and subsequently must be explicitly deallocated using
125 argument is non-null it must point to at least 41 characters of buffer space.
132 These functions appeared in
135 The core hash routines were implemented by Eric Young based on the
140 No method is known to exist which finds two files having the same hash value,
141 nor to find a file with a specific hash value.
142 There is on the other hand no guarantee that such a method does not exist.