A Skein API and its functions. More...
Go to the source code of this file.
A Skein API and its functions.
This API and the functions that implement this API simplify the usage of Skein. The design and the way to use the functions follow the openSSL design but at the same time take care of some Skein specific behaviour and possibilities.
The functions enable applications to create a normal Skein hashes and message authentication codes (MAC).
Using these functions is simple and straight forward:
An application may use skeinReset
to reset a Skein context and use it for creation of another hash with the same Skein state size and output bit length. In this case the API implementation restores some internal internal state data and saves a full Skein initialization round.
To create a MAC the application just uses skeinMacInit
instead of skeinInit
. All other functions calls remain the same.
Definition in file skeinApi.h.
Context for Skein.
This structure was setup with some know-how of the internal Skein structures, in particular ordering of header and size dependent variables. If Skein implementation changes this, then adapt these structures as well.
Which Skein size to use.
Which Skein size to use.
Enumerator | |
---|---|
Skein256 |
Skein with 256 bit state |
Skein512 |
Skein with 512 bit state |
Skein1024 |
Skein with 1024 bit state |
Definition at line 104 of file skeinApi.h.
Prepare a Skein context.
An application must call this function before it can use the Skein context. The functions clears memory and initializes size dependent variables.
Finalize Skein and return the hash.
Before an application can reuse a Skein setup the application must reinitialize the Skein context.See the approriate initialization methods how to achieve this.
hashBitLen
bits. Initialize a Skein context.
Initializes the context with this data and saves the resulting Skein state variables for further use.
Initializes or reuses a Skein context for MAC usage.
Initializes the context with this data and saves the resulting Skein state variables for further use.
Applications call the normal Skein functions to update the MAC and get the final result.
Resets a Skein context for furter use.
Restores the saved chaining variables to reset the Skein context. Thus applications can reuse the same setup to process several messages. This saves a complete Skein initialization cycle.
Update Skein with the next part of the message.
Update the hash with a message bit string.
Skein can handle data not only as bytes but also as bit strings of arbitrary length (up to its maximum design size).