Subject: Re: [boost] NuDB: A fast key/value insert-only database for SSD drives in C++11
From: Vinnie Falco (vinnie.falco_at_[hidden])
Date: 2017-03-27 11:21:55
On Mon, Mar 27, 2017 at 6:57 AM, Niall Douglas via Boost
> The point being made here is that you need to use a high quality secure
> hash when writing data to storage. That way after power loss you can
> determine if the database store is truly in a consistent and valid state
> rather than being tricked into thinking it is, and then unwittingly
> destroying more user data.
Oh...I misunderstood. The hash function in NuDB is not used to
calculate a digest of the value, its used only to determine which
bucket to place the key in the hash table. NuDB is essentially an
on-disk unordered_map. That is why the hash function does not need to
be cryptographically secure.
In the use-cases for which NuDB is designed (blockchain applications)
the key used for insertion is usually a cryptographic digest of the
value. So its up to the application to use a cryptographically secure
hash function for computing keys. However, this is part of the
caller's implementation and not part of the library.