This file comes from http://www.cs.technion.ac.il/~biham/Reports/Tiger/
Inclusion in gtk-gnutella is:
#include "common.h"
#include "endian.h"
#include "misc.h"
#include "base32.h"
#include "tiger.h"
#include "override.h"
#include "tiger_sboxes.h"
Defines | |
| #define | PASSES 3 |
| #define | U64_FROM_2xU32(hi, lo) (((guint64) (hi) << 32) | (lo)) |
| #define | t1 (tiger_sboxes) |
| #define | t2 (&tiger_sboxes[256]) |
| #define | t3 (&tiger_sboxes[256*2]) |
| #define | t4 (&tiger_sboxes[256*3]) |
| #define | save_abc |
| #define | round(a, b, c, x, mul) |
| #define | pass(a, b, c, mul) |
| #define | key_schedule |
| #define | feedforward |
| #define | compress |
| #define | tiger_compress_macro(str, state) |
Functions | |
| void | tiger_compress (const guint64 *data, guint64 state[3]) |
| void | tiger (gconstpointer data, guint64 length, gchar hash[24]) |
| void | tiger_check (void) |
| Runs some test cases to check whether the implementation of the tiger hash algorithm is alright. | |
|
|
Value: save_abc \ pass(a,b,c,5) \ key_schedule \ pass(c,a,b,7) \ key_schedule \ pass(b,c,a,9) \ for(pass_no=3; pass_no<PASSES; pass_no++) { \ key_schedule \ pass(a,b,c,9) \ tmpa=a; a=c; c=b; b=tmpa;} \ feedforward |
|
|
Value: a ^= aa; \
b -= bb; \
c += cc;
|
|
|
Value: x[0] -= x[7] ^ U64_FROM_2xU32(0xA5A5A5A5UL, 0xA5A5A5A5UL); \ x[1] ^= x[0]; \ x[2] += x[1]; \ x[3] -= x[2] ^ ((~x[1])<<19); \ x[4] ^= x[3]; \ x[5] += x[4]; \ x[6] -= x[5] ^ ((~x[4])>>23); \ x[7] ^= x[6]; \ x[0] += x[7]; \ x[1] -= x[0] ^ ((~x[7])<<19); \ x[2] ^= x[1]; \ x[3] += x[2]; \ x[4] -= x[3] ^ ((~x[2])>>23); \ x[5] ^= x[4]; \ x[6] += x[5]; \ x[7] -= x[6] ^ U64_FROM_2xU32(0x01234567UL, 0x89ABCDEFUL); |
|
|
Value: |
|
|
|
|
|
Value: |
|
|
Value: aa = a; \
bb = b; \
cc = c;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Value: { \
guint64 a, b, c, tmpa; \
guint64 aa, bb, cc; \
guint64 x[8]; \
int pass_no, i; \
\
a = state[0]; \
b = state[1]; \
c = state[2]; \
\
for (i = 0; i < 8; i++) x[i] = str[i]; \
\
compress; \
\
state[0] = a; \
state[1] = b; \
state[2] = c; \
}
|
|
|
|
|
||||||||||||||||
|
|
|
|
Runs some test cases to check whether the implementation of the tiger hash algorithm is alright.
|
|
||||||||||||
|
|
1.3.9.1