Main index | Section 3 | Options |
#include <sys/types.h>
#include <skein.h>
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.
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.
SKEIN (3) | May 28, 2016 |
Main index | Section 3 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | The most important thing in the programming language is the name. A language will not succeed without a good name. I have recently invented a very good name and now I am looking for a suitable language. | ” |
— Donald Knuth |