3 ms·
As one more comment, because I've made the same mistake in the past, it is often a bad idea to use the length in the initialization vector of a general purpose
by jandrewrogers 8y ago
As one more comment, because I've made the same mistake in the past, it is often a bad idea to use the length in the initialization vector of a general purpose hash because it means you can't make an incremental version of the hashing algorithm e.g. a stream of data of unknown size. This is a trivial change but it has side effects in how you pad partial blocks.
If the length is not part of the initialization vector, then the padding vector for partial blocks should vary as a function of partial data length. Otherwise it is trivial to create collisions by having partial blocks of different sizes that mimic the padding vector. Fixing this can be as easy as using _mm_set1_epi8(partial_length) as your padding vector.
- 0xb100db1ade 8y agoOn the other hand, https://en.wikipedia.org/wiki/Length_extension_attack https://en.wikipedia.org/wiki/Length_extension_attack Although Meow Hash is described as non-cryptographic, so the described attack is likely not applicable
- DrJosiah 8y agoI'm a fan of your work; I've personally mangled your Metrohash64 in some of my own work for incremental updates. Any chance you're thinking about releasing the program for generating new (good) Metrohash constants + shifts?
- jandrewrogers 8y agoI have a completely new algorithm construction I have been using for a while that I am releasing any day now -- I was literally working on the documentation this weekend. It is a substantial improvement on the original algorithms in almost every regard and also easier to customize.
- DrJosiah 8y agoI look forward to the release, and I know the feeling (writing docs, cleaning up comments, etc.). I've been perpetually ~2 weeks from commercial release of my own product since July or so.