SKEIN512_End3
Calculate the ``skein'' family of message digests
Part of SKEIN1024_Data(3).
Usage
void
void
void
char *
char *
char *
char *
char *
char *
void
void
void
char *
char *
char *
char *
char *
char *
void
void
void
char *
char *
char *
char *
char *
char *
Library
library “libmd”
Overview
Skein is a new family of cryptographic hash functions based on the Threefish large-block cipher. Its design combines speed, security, simplicity, and a great deal of flexibility in a modular package that is easy to analyze. Skein is defined for three different internal state sizes—256 bits, 512 bits, and 1024 bits—and any output size. This allows Skein to be a drop-in replacement for the entire SHA family of hash functions.
The SKEIN256_Init(), SKEIN256_Update(), and SKEIN256_Final() functions are the core functions. Allocate an SKEIN256_CTX, initialize it with SKEIN256_Init(), run over the data with SKEIN256_Update(), and finally extract the result using SKEIN256_Final(), which will also erase the SKEIN256_CTX.
SKEIN256_End() is a wrapper for SKEIN256_Final() which converts the return value to a 33-character (including the terminating '\0') ASCII string which represents the 256 bits in hexadecimal.
SKEIN256_File() calculates the digest of a file, and uses SKEIN256_End() to return the result. If the file cannot be opened, a null pointer is returned. SKEIN256_FileChunk() is similar to SKEIN256_File(), but it only calculates the digest over a byte-range of the file specified, starting at offset and spanning length bytes. If the length parameter is specified as 0, or more than the length of the remaining part of the file, SKEIN256_FileChunk() calculates the digest from offset to the end of file. SKEIN256_Data() calculates the digest of a chunk of data in memory, and uses SKEIN256_End() to return the result.
The SKEIN256_Fd() and SKEIN256_FdChunk() functions are identical to their SKEIN256_File() and SKEIN256_FileChunk() counterparts, with the exception that the first argument is an fd instead of a filename.
When using SKEIN256_End(), SKEIN256_File(), or SKEIN256_Data(), the buf argument can be a null pointer, in which case the returned string is allocated with malloc(3) and subsequently must be explicitly deallocated using free(3) after use. If the buf argument is non-null it must point to at least 33 characters of buffer space.
The SKEIN512_ and SKEIN1024_ functions are similar to the SKEIN256_ functions except they produce a 512-bit, 65 character, or 1024-bit, 129 character, output.
Errors
The SKEIN256_End() function called with a null buf argument may fail and return NULL if:
- [ENOMEM]
-
Insufficient storage space is available.
The SKEIN256_File() and SKEIN256_FileChunk() may return NULL when underlying open(2), fstat(2), lseek(2), or SKEIN256_End(3) fail.
History
- FreeBSD 16.0-CURRENT (2026-10-27) to FreeBSD 15.0-RELEASE: the text shown here
- FreeBSD 14.5-RELEASE to FreeBSD 14.0-RELEASE
- FreeBSD 13.5-RELEASE to FreeBSD 13.3-RELEASE
- FreeBSD 13.2-RELEASE
- FreeBSD 13.1-RELEASE to FreeBSD 13.0-RELEASE
- FreeBSD 12.4-RELEASE
- FreeBSD 12.3-RELEASE
- FreeBSD 12.2-RELEASE
- FreeBSD 12.1-RELEASE
- FreeBSD 12.0-RELEASE
- FreeBSD 11.4-RELEASE
- FreeBSD 11.3-RELEASE
- FreeBSD 11.2-RELEASE
- FreeBSD 11.1-RELEASE
- FreeBSD 11.0-RELEASE