Manual Reference Pages - SHA_FILECHUNK (3)
- calculate the FIPS 160 and 160-1 SHA message digests
SHA_Init SHA_CTX *context
SHA_Update SHA_CTX *context const unsigned char *data size_t len
SHA_Final unsigned char digest SHA_CTX *context
SHA_End SHA_CTX *context char *buf
SHA_File const char *filename char *buf
SHA_FileChunk const char *filename char *buf off_t offset off_t length
SHA_Data const unsigned char *data unsigned int len char *buf
SHA1_Init SHA_CTX *context
SHA1_Update SHA_CTX *context const unsigned char *data size_t len
SHA1_Final unsigned char digest SHA_CTX *context
SHA1_End SHA_CTX *context char *buf
SHA1_File const char *filename char *buf
SHA1_FileChunk const char *filename char *buf off_t offset off_t length
SHA1_Data const unsigned char *data unsigned int len char *buf
functions calculate a 160-bit cryptographic checksum (digest)
for any number of input bytes.
A cryptographic checksum is a one-way
hash function; that is, it is computationally impractical to find
the input corresponding to a particular output.
This net result is
of the input-data, which does not disclose the actual input.
is the original Secure Hash Algorithm specified in
It was quickly proven insecure, and has been superseded by
is included for compatibility purposes only.
functions are the core functions.
.Vt SHA_CTX ,
initialize it with
run over the data with
and finally extract the result using
is a wrapper for
which converts the return value to a 41-character
(including the terminating \0)
string which represents the 160 bits in hexadecimal.
calculates the digest of a file, and uses
to return the result.
If the file cannot be opened, a null pointer is returned.
is similar to
but it only calculates the digest over a byte-range of the file specified,
parameter is specified as 0, or more than the length of the remaining part
of the file,
calculates the digest from
to the end of file.
calculates the digest of a chunk of data in memory, and uses
to return the result.
argument can be a null pointer, in which case the returned string
is allocated with
and subsequently must be explicitly deallocated using
argument is non-null it must point to at least 41 characters of buffer space.
These functions appeared in
.Fx 4.0 .
The core hash routines were implemented by Eric Young based on the
No method is known to exist which finds two files having the same hash value,
nor to find a file with a specific hash value.
There is on the other hand no guarantee that such a method does not exist.
(Intel) implementation of
makes heavy use of the
instruction, which is not present on the original 80386.
Attempts to use
on those processors will cause an illegal instruction trap.
(Arguably, the kernel should simply emulate this instruction.)
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.