Build time implementation of tiger hash; result is wrong WiP

This commit is contained in:
King_DuckZ 2015-06-21 02:42:52 +02:00
parent dba88117e4
commit 0dada705aa
5 changed files with 557 additions and 28 deletions

View file

@ -11,20 +11,19 @@ namespace dk {
namespace implem {
HashType hash_string (const char* parString, std::size_t parLen) {
union {
HashType hash;
t_res array;
} retval;
t_res retval;
tiger(parString, parLen, retval.array, TigerPaddingV2);
return retval.hash;
}
::tiger(parString, parLen, retval, TigerPaddingV2);
bool HashType::operator< (const HashType& parOther) const {
return a < parOther.a or
(a == parOther.a and b < parOther.b) or
(a == parOther.a and b == parOther.b and c < parOther.c)
;
HashType hash(retval[0], retval[1], retval[2]);
return hash;
}
} //namespace implem
bool operator< (const HashType& parL, const HashType& parR) {
return parL.a < parR.a or
(parL.a == parR.a and parL.b < parR.b) or
(parL.a == parR.a and parL.b == parR.b and parL.c < parR.c)
;
}
} //namespace dk