<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2018-08-10 6:57 GMT+08:00 Faré <span dir="ltr"><<a href="mailto:fahree@gmail.com" target="_blank">fahree@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, Aug 8, 2018 at 2:33 AM Marc Feeley <<a href="mailto:feeley@iro.umontreal.ca">feeley@iro.umontreal.ca</a>> wrote:<br>
><br>
> Add a feature request issue for this.  Non-determinism is bad for debugging.  And I view “production runs” as debugging because when something goes wrong in production once in a blue moon you need to debug that particular run.<br>
><br>
</span>If Gambit were to salt its hashes, the salt(s) and/or the random seed<br>
used to compute the salt(s) ought to be setable by users early enough<br>
(if needs be on the command-line).<br>
<br>
Adam: can the salt be per-table (or per-type) or does it have to be<br>
global? Can you do it in user-space?<br></blockquote><div><br></div><div>As I understand it, the salt can be both per table and global. There is no reason that the user would not be allowed to specify the salt per table. If random u8vector may not be super fast, then maybe just copy the default per-table salt from a global variable that's generated once at startup.</div><div><br></div><div>Having salt randomization on by default would follow a "secure by default" reasoning - someone could use a hashtable in an exploitable place, and not be aware of the DDOS implications hashtables can have.</div><div><br></div><div>Of course as a user you can add hash salting on top of Gambit's hashtables yourself, by cons:ing on a random constant to all your table keys, or by implementing your own hashing function and telling Gambit to use it.</div><div><br></div><div><br></div><div>(Some more thoughts,</div><div><br></div><div>I see the point about determinism of software execution, however isn't the only effect of the randomization that table operations will have slightly different execution times which mean nondeterminism, aren't there some other common sources of nondeterminism around such as variance in OS thread execution speed or IO speed, that could complicate debugging already and even more than hashtable behavior -</div><div><br></div><div>Anyhow an optional salt works too. Hashtable DDOS security is really not a normally notable threat, it just occurred to me to bring it up for completeness, that was all. Yep should add a feature request.)</div></div></div></div>