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
21 .Nm SHA512_FileChunk ,
28 .Nm SHA384_FileChunk ,
30 .Nd calculate the FIPS 180-4 ``SHA-512'' family of message digests
37 .Fn SHA512_Init "SHA512_CTX *context"
39 .Fn SHA512_Update "SHA512_CTX *context" "const unsigned char *data" "size_t len"
41 .Fn SHA512_Final "unsigned char digest[64]" "SHA512_CTX *context"
43 .Fn SHA512_End "SHA512_CTX *context" "char *buf"
45 .Fn SHA512_File "const char *filename" "char *buf"
47 .Fn SHA512_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length"
49 .Fn SHA512_Data "const unsigned char *data" "unsigned int len" "char *buf"
51 .Fn SHA384_Init "SHA384_CTX *context"
53 .Fn SHA384_Update "SHA384_CTX *context" "const unsigned char *data" "size_t len"
55 .Fn SHA384_Final "unsigned char digest[48]" "SHA384_CTX *context"
57 .Fn SHA384_End "SHA384_CTX *context" "char *buf"
59 .Fn SHA384_File "const char *filename" "char *buf"
61 .Fn SHA384_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length"
63 .Fn SHA384_Data "const unsigned char *data" "unsigned int len" "char *buf"
67 functions calculate a 512-bit cryptographic checksum (digest)
68 for any number of input bytes.
69 A cryptographic checksum is a one-way
70 hash function; that is, it is computationally impractical to find
71 the input corresponding to a particular output.
75 of the input-data, which does not disclose the actual input.
82 functions are the core functions.
87 run over the data with
89 and finally extract the result using
95 which converts the return value to a 65-character
96 (including the terminating '\e0')
98 string which represents the 512 bits in hexadecimal.
101 calculates the digest of a file, and uses
103 to return the result.
104 If the file cannot be opened, a null pointer is returned.
108 but it only calculates the digest over a byte-range of the file specified,
116 parameter is specified as 0, or more than the length of the remaining part
119 calculates the digest from
123 calculates the digest of a chunk of data in memory, and uses
125 to return the result.
134 argument can be a null pointer, in which case the returned string
137 and subsequently must be explicitly deallocated using
142 argument is non-null it must point to at least 65 characters of buffer space.
146 functions are identical to the
148 functions except they use a different initial hash value and the output is
149 truncated to 384 bits.
154 which converts the return value to a 49-character
155 (including the terminating '\e0')
157 string which represents the 384 bits in hexadecimal.
164 These functions appeared in
167 The core hash routines were implemented by Colin Percival based on
172 No method is known to exist which finds two files having the same hash value,
173 nor to find a file with a specific hash value.
174 There is on the other hand no guarantee that such a method does not exist.