1 #ifndef INCLUDED_TIGER_H
2 #define INCLUDED_TIGER_H
3 /* vim: set ts=8 sts=4 sw=4 tw=80 noet: */
4 /*======================================================================
5 Copyright (C) 2004,2005,2009 Walter Doekes <walter+tthsum@wjd.nu>
6 This file is part of tthsum.
7 
8 tthsum is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12 
13 tthsum is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with tthsum.  If not, see <http://www.gnu.org/licenses/>.
20 ======================================================================*/
21 
22 /**
23  * The tiger3/192 hash algorithm (192 bits, 3 passes)
24  */
25 
26 #include "types.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* __cplusplus */
31 
32 /**
33  * The Tiger Hash function.
34  * Supply an 64-bit aligned octet-stream and the length of the _octet_ stream.
35  * The last parameter, result, must be large enough to hold 3 uint64_t's.
36  */
37 void tiger(const uint64_t* data, unsigned length, uint64_t* result);
38 
39 /**
40  * The Tiger Hash function, modified to prepend the specified byte to the input
41  * data. This is useful for the THEX algorithm which prepends a 0x00 to leaf
42  * nodes and 0x01 to the hash nodes.
43  *
44  * Note that this function does not align the data properly on little endian
45  * machines. On big endian machines it will re-align because it copies the
46  * data to a temporary buffer while converting the little endian input.
47  *
48  * See tiger() for details of the other arguments.
49  */
50 void tiger_bp(char prepend, const void* data, unsigned length,
51 	uint64_t* result);
52 
53 #ifdef __cplusplus
54 } /* extern "C" */
55 #endif /* __cplusplus */
56 
57 #endif /* INCLUDED_TIGER_H */
58