Boost logo

Boost :

Subject: Re: [boost] [optional] operator<(optional<T>, T) -- is it wrong?
From: Howard Hinnant (howard.hinnant_at_[hidden])
Date: 2014-12-02 17:40:40


On Dec 2, 2014, at 3:44 PM, Niall Douglas <s_sourceforge_at_[hidden]> wrote:

> Out of curiosity I went and looked up what Python did to solve this
> (here's the discussion: http://bugs.python.org/issue13703). In the
> end, they simply XOR salted the hash with a cryptographically
> generated random number produced at process launch (source:
> https://docs.python.org/3/reference/datamodel.html#object.__hash__)
> and carried on with their previous algorithm.

Here is a very short python script:

https://131002.net/siphash/poc.py

which appears to recover those random salts for the process. I tried it out on 2.7.5 and it appears to work really well. This comes from the SipHash website, which also contains short programs for compromising randomly seeded MurmurHash and CityHash.

Howard


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk