#include "adchpp.h"
#include "TigerHash.h"
#include "common.h"
Go to the source code of this file.
Namespaces | |
namespace | adchpp |
Defines | |
#define | compress |
#define | feedforward |
#define | key_schedule |
#define | pass(a, b, c, mul) |
#define | PASSES 3 |
#define | round(a, b, c, x, mul) |
#define | save_abc |
#define | t1 (table) |
#define | t2 (table+256) |
#define | t3 (table+256*2) |
#define | t4 (table+256*3) |
#define | tiger_compress_macro(str, state) |
#define compress |
save_abc \ for(pass_no=0; pass_no<PASSES; pass_no++) { \ if(pass_no != 0) {key_schedule} \ pass(a,b,c,(pass_no==0?5:pass_no==1?7:9)); \ tmpa=a; a=c; c=b; b=tmpa;} \ feedforward
Definition at line 85 of file TigerHash.cpp.
#define feedforward |
a ^= aa; \ b -= bb; \ c += cc;
Definition at line 80 of file TigerHash.cpp.
#define key_schedule |
x0 -= x7 ^ _ULL(0xA5A5A5A5A5A5A5A5); \ x1 ^= x0; \ x2 += x1; \ x3 -= x2 ^ ((~x1)<<19); \ x4 ^= x3; \ x5 += x4; \ x6 -= x5 ^ ((~x4)>>23); \ x7 ^= x6; \ x0 += x7; \ x1 -= x0 ^ ((~x7)<<19); \ x2 ^= x1; \ x3 += x2; \ x4 -= x3 ^ ((~x2)>>23); \ x5 ^= x4; \ x6 += x5; \ x7 -= x6 ^ _ULL(0x0123456789ABCDEF);
Definition at line 62 of file TigerHash.cpp.
#define pass | ( | a, | |||
b, | |||||
c, | |||||
mul | ) |
#define PASSES 3 |
Definition at line 28 of file TigerHash.cpp.
#define round | ( | a, | |||
b, | |||||
c, | |||||
x, | |||||
mul | ) |
c ^= x; \ a -= t1[(uint8_t)(c)] ^ \ t2[(uint8_t)(((uint32_t)(c))>>(2*8))] ^ \ t3[(uint8_t)((c)>>(4*8))] ^ \ t4[(uint8_t)(((uint32_t)((c)>>(4*8)))>>(2*8))] ; \ b += t4[(uint8_t)(((uint32_t)(c))>>(1*8))] ^ \ t3[(uint8_t)(((uint32_t)(c))>>(3*8))] ^ \ t2[(uint8_t)(((uint32_t)((c)>>(4*8)))>>(1*8))] ^ \ t1[(uint8_t)(((uint32_t)((c)>>(4*8)))>>(3*8))]; \ b *= mul;
Definition at line 40 of file TigerHash.cpp.
#define save_abc |
aa = a; \ bb = b; \ cc = c;
Definition at line 35 of file TigerHash.cpp.
#define t1 (table) |
Definition at line 30 of file TigerHash.cpp.
Referenced by adchpp::Signal< F >::operator()().
#define t2 (table+256) |
Definition at line 31 of file TigerHash.cpp.
Referenced by adchpp::Signal< F >::operator()().
#define t3 (table+256*2) |
Definition at line 32 of file TigerHash.cpp.
#define t4 (table+256*3) |
Definition at line 33 of file TigerHash.cpp.
#define tiger_compress_macro | ( | str, | |||
state | ) |
{ \ register uint64_t a, b, c, tmpa; \ uint64_t aa, bb, cc; \ register uint64_t x0, x1, x2, x3, x4, x5, x6, x7; \ int pass_no; \ \ a = state[0]; \ b = state[1]; \ c = state[2]; \ \ x0=str[0]; x1=str[1]; x2=str[2]; x3=str[3]; \ x4=str[4]; x5=str[5]; x6=str[6]; x7=str[7]; \ \ compress; \ \ state[0] = a; \ state[1] = b; \ state[2] = c; \ }
Definition at line 93 of file TigerHash.cpp.
Referenced by adchpp::TigerHash::tigerCompress().