#include <stddef.h>
#include "sph_types.h"
Go to the source code of this file.
Data Structures | |
struct | sph_tiger_context |
Defines | |
#define | SPH_SIZE_tiger 192 |
#define | SPH_SIZE_tiger2 192 |
Typedefs | |
typedef sph_tiger_context | sph_tiger2_context |
Functions | |
void | sph_tiger_init (void *cc) |
void | sph_tiger (void *cc, const void *data, size_t len) |
void | sph_tiger_close (void *cc, void *dst) |
void | sph_tiger_comp (const sph_u64 msg[8], sph_u64 val[3]) |
void | sph_tiger2_init (void *cc) |
void | sph_tiger2 (void *cc, const void *data, size_t len) |
void | sph_tiger2_close (void *cc, void *dst) |
void | sph_tiger2_comp (const sph_u64 msg[8], sph_u64 val[3]) |
Tiger / Tiger-2 interface.
Tiger has been published in: R. Anderson, E. Biham, "Tiger: A Fast New Hash Function", Fast Software Encryption - FSE'96, LNCS 1039, Springer (1996), pp. 89--97.
Tiger2 has never been formally published, but it was described as identical to Tiger, except for the padding which is the same in Tiger2 as it is in MD4. Fortunately, an implementation of Tiger2 was submitted to NESSIE, which produced test vectors; the sphlib implementation of Tiger2 is compatible with the NESSIE test vectors.
==========================(LICENSE BEGIN)============================
Copyright (c) 2007-2010 Projet RNRT SAPHIR
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
===========================(LICENSE END)=============================
#define SPH_SIZE_tiger 192 |
Output size (in bits) for Tiger.
#define SPH_SIZE_tiger2 192 |
Output size (in bits) for Tiger2.
typedef sph_tiger_context sph_tiger2_context |
This structure is a context for Tiger2 computations. It is identical to the Tiger context, and they may be freely exchanged, since the difference between Tiger and Tiger2 resides solely in the padding, which is computed only in the last computation step.
void sph_tiger_init | ( | void * | cc | ) |
Initialize a Tiger context. This process performs no memory allocation.
cc | the Tiger context (pointer to a sph_tiger_context ) |
void sph_tiger | ( | void * | cc, | |
const void * | data, | |||
size_t | len | |||
) |
Process some data bytes. It is acceptable that len
is zero (in which case this function does nothing).
cc | the Tiger context | |
data | the input data | |
len | the input data length (in bytes) |
void sph_tiger_close | ( | void * | cc, | |
void * | dst | |||
) |
Terminate the current Tiger computation and output the result into the provided buffer. The destination buffer must be wide enough to accomodate the result (24 bytes). The context is automatically reinitialized.
cc | the Tiger context | |
dst | the destination buffer |
Apply the Tiger compression function on the provided data. The msg
parameter contains the 8 64-bit input blocks, as numerical values (hence after the little-endian decoding). The val
parameter contains the 3 64-bit input blocks for the compression function; the output is written in place in this array.
msg | the message block (8 values) | |
val | the function 192-bit input and output |
void sph_tiger2_init | ( | void * | cc | ) |
Initialize a Tiger2 context. This function is identical to sph_tiger_init()
.
cc | the Tiger2 context (pointer to a sph_tiger2_context ) |
void sph_tiger2 | ( | void * | cc, | |
const void * | data, | |||
size_t | len | |||
) |
Process some data bytes. This function is identical to sph_tiger()
.
cc | the Tiger2 context | |
data | the input data | |
len | the input data length (in bytes) |
void sph_tiger2_close | ( | void * | cc, | |
void * | dst | |||
) |
Terminate the current Tiger2 computation and output the result into the provided buffer. The destination buffer must be wide enough to accomodate the result (24 bytes). The context is automatically reinitialized. Note that this function is NOT identical to sph_tiger2_close()
: this is the exact and unique point where Tiger and Tiger2 differ.
cc | the Tiger context | |
dst | the destination buffer |