Bulat-Ziganshin / FARSH

Fast and Reliable (but not Secure) Hash
MIT License
53 stars 4 forks source link

Farsh quality #6

Closed Cyan4973 closed 5 years ago

Cyan4973 commented 5 years ago

Hi @Bulat-Ziganshin ,

I've been recently interested in your hash algorithm farsh, and noticed it could vectorize very well, which is great for speed on large inputs.

However, in a couple of comments, you seem to express some doubts about the resulting hash quality :

it's not as reliable as the competition i don't consider farsh as good hash due to its construction.

The text in this last issue also gives a few words to explain why ("hashes that sequentially update state with input words, are less vulnerable to changes in input data that compensate each other"), but I'm not sure to follow. Do you still believe Farsh, and by extension UMAC, has some kind of "flaw" that makes it a poor fit for hash generation and/or checksumming ? And if yes, could you describe your concerns ?

Cyan4973 commented 5 years ago

I went ahead and used a modified version of UMAC for XXH3. On top of using multiple lanes to ensure a wide enough internal state, it also uses a modified formula, to ensure that no segment of the input can get "nullified", something which can accidentally happen in UMAC. The new formula is a bit slower, but it still proves fast enough.