[Cryptography] Introducing the world's worst hash function

Jerry Leichter leichter at lrw.com
Tue Jan 29 11:22:51 EST 2019


> Modern hash function are designed to be as efficient as possible on pipelined,
> superscalar processors, but what if you wanted one that was the exact
> opposite?  I needed a function to create small random delays but couldn't just
> Sleep() or usleep() or nanosleep() or whatever since that's too granular.
> What I needed was a fine-grained delay function, which led to MurMurHash's
> mutant cousin MerdeMerdeHash, the one they keep locked in the basement and
> only let out once the guest have left....
An interesting bit of history:  VMS needed a way to introduce short delays at certain points (especially in drivers).  The clock's resolution was way too coarse for this purpose; what was needed was a delay loop.  But since VMS would run on a variety of processors - including processors that might not exist when the code was compiled - it needed to adjust dynamically.

So during boot time, some code was run that timed very large numbers of iterations of a simple loop, enough that you could actually get a useful timing value from the available clocks.  From that, the number of iterations needed for the loop to reach the desired interval was computed.  Then the code being loaded was actually searched for markers pre-inserted to show where a delay loop was needed, and the necessary code was patched in.

Today we might have problems with a patch-at-runtime approach as it's inconsistent (without a lot of extra work) with verified boot mechanisms.  But it was an elegant approach, back in the day!
                                                        -- Jerry



More information about the cryptography mailing list