Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2024-12-16 17:49:08


Antony Polukhin wrote:
> Or there is a plan to go further and provide adapters
> for hash algorithms usage with unordered containers?

There is, yes. Several are currently shown as examples

https://pdimov.github.io/hash2/doc/html/hash2.html#example_use_with_unordered_containers

and one will eventually be added to the library proper once
we're confident it's the right one.

> Third, using a single process-wide seed is not good practice (as you
> yourself
> observe.) It makes things more secure compared to unseeded use, but
> not
> really secure. The correct approach is to use a random seed (preferably
> of
> size 192 bits or more) that varies per connection, or per container.
>
>
>
> Those 192 bits seem to be related to a particular hashing algorithm. Looks like
> it makes sense for the hashing algorithm implementor to provide some
> information on seed length. Is there any plan to get that information from
> algorithm?

No, the current approach is to make all hash algorithms be able to consume
arbitrary seeds, so that user code doesn't need to change when the algorithm
is changed.

192 bits isn't related to a particular hash algorithm, it's just the minimum
amount of entropy you'd need today to be reasonably confident of security.

Use 256 bits of entropy to be sure.


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