4 ms·
Hash functions and block ciphers
- tptacek 15y agoI like a lot of what Bob Jenkins writes, and I think(?) I may still be using his hash table library as my hash_t in my C code, but I still wouldn't use anything he designed in place of SHA256 or AES; so, just that word of caution.
- wladimir 15y agoThat's appropriate, because hashing for hash tables has entirely different requirements than cryptographic hashing. For a hash table you want a function that evaluates really fast, is short, but produces as little collisions as possible given that constraint. A cryptographic hash can be slower and have more steps, but it should be extremely hard to find a plaintext with a pre-defined hash value, or produce collisions, or one of the many other threat scenarios.
- brugidou 15y agoi think it's worth pointing out the new murmurhash 3 for lookup table hashing, it has gone a long way and is supposed to be _really_ fast: http://code.google.com/p/smhasher/ http://code.google.com/p/smhasher/ The author of murmurhash actually based their work on Bob Jenkin's trying to make it speedier, and developed a nice hash test suite.
- chanux 15y agoDoesn't load for me. Google cache here : http://webcache.googleusercontent.com/search?client=ubuntu&channel=fs&q=cache%3Ahttp%3A%2F%2Fburtleburtle.net%2Fbob%2Fhash%2F&ie=utf-8&oe=utf-8 http://webcache.googleusercontent.com/search?client=ubuntu&#...
- bajsejohannes 15y ago> Also, % can be extremely slow (230 times slower than addition on a Sparc). This is surprising. For comparison, I did a test on my Intel Core 2 Duo. Modulo turned out to be about 8.5 times slower than addition. A lot better than Sparc, but it might still be to slow for certain applications.