SHA512(3) BSD Library Functions Manual SHA512(3)
NAME
SHA512_Init, SHA512_Update, SHA512_Final, SHA512_End, SHA512_File, SHA512_FileChunk, SHA512_Data -- calculate the FIPS 180-2 ``SHA-512'' mes-
sage digest
LIBRARY
Message Digest (MD4, MD5, etc.) Support Library (libmd, -lmd)
SYNOPSIS
#include <sys/types.h>
#include <sha512.h>
void
SHA512_Init(SHA512_CTX *context);
void
SHA512_Update(SHA512_CTX *context, const unsigned char *data, size_t len);
void
SHA512_Final(unsigned char digest[64], SHA512_CTX *context);
char *
SHA512_End(SHA512_CTX *context, char *buf);
char *
SHA512_File(const char *filename, char *buf);
char *
SHA512_FileChunk(const char *filename, char *buf, off_t offset, off_t length);
char *
SHA512_Data(const unsigned char *data, unsigned int len, char *buf);
DESCRIPTION
The SHA512_ functions calculate a 512-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 a
``fingerprint'' of the input-data, which does not disclose the actual input.
The SHA512_Init(), SHA512_Update(), and SHA512_Final() functions are the core functions. Allocate an SHA512_CTX, initialize it with
SHA512_Init(), run over the data with SHA512_Update(), and finally extract the result using SHA512_Final().
SHA512_End() is a wrapper for SHA512_Final() which converts the return value to a 65-character (including the terminating '