Ordo
0.3.4
Symmetric Cryptography Library
|
Primitive. More...
#include "ordo/primitives/hash_functions.h"
Go to the source code of this file.
Functions | |
ORDO_PUBLIC int | skein256_init (struct SKEIN256_STATE *state, const struct SKEIN256_PARAMS *params) |
ORDO_PUBLIC void | skein256_update (struct SKEIN256_STATE *state, const void *buffer, size_t len) |
ORDO_PUBLIC void | skein256_final (struct SKEIN256_STATE *state, void *digest) |
ORDO_PUBLIC size_t | skein256_query (int query, size_t value) |
ORDO_PUBLIC size_t | skein256_bsize (void) |
Primitive.
This is the Skein-256 hash function, which produces a 256-bit digest by default (but has parameters to output a longer digest) and has a 256-bit internal state. This implementation supports messages up to a length of 2^64 - 1 bytes instead of the 2^96 - 1 available, but we trust this will not be an issue. This is a rather flexible hash with lots of options. Currently, the only options supported are:
SKEIN256_PARAMS
is the configuration block, and a default one is used if not provided) with the exception of the output length which must remain 256 bits.Note arbitrary output length used to be supported, but is no longer, since parameters should not leak through the interface, and this feature is also available in a more generic way via key stretching modules such as HKDF or DRBG.
ORDO_PUBLIC int skein256_init | ( | struct SKEIN256_STATE * | state, |
const struct SKEIN256_PARAMS * | params | ||
) |
hash_init()
ORDO_ARG | if parameters were provided, but requested an output length of zero bytes. |
ORDO_PUBLIC void skein256_update | ( | struct SKEIN256_STATE * | state, |
const void * | buffer, | ||
size_t | len | ||
) |
hash_update()
ORDO_PUBLIC void skein256_final | ( | struct SKEIN256_STATE * | state, |
void * | digest | ||
) |
hash_final()
ORDO_PUBLIC size_t skein256_query | ( | int | query, |
size_t | value | ||
) |
hash_query()
ORDO_PUBLIC size_t skein256_bsize | ( | void | ) |
Gets the size in bytes of a SKEIN256_STATE
.