-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set64::insert() panics #16
Comments
Thanks for the report! I'll try to get to this soon. Do you think you could get a pull request in with this as a failing test? |
As it turns out I was able to get it done this morning. Thanks again for the report! At first I thought this wasn't likely to be a real bug (i.e. wrapping add would turn out to be what we wanted), but since tinyset randomizes the size of the hash table, it is not a power of two, and this really did give incorrect behavior! Regarding your other question with regard to randomization, there is a default feature called The use of the randomization is to provide some protection against collision DOS attacks. It's not very sophisticated (we don't hash the numbers!), we just randomize the size of the table when we grow it, so attackers shouldn't be able to guess integers that are identical modulo the length of the table. This also protects us a bit from non-attacker DOS simply caused by a bunch of values differing by |
Hi, thanks for responding so quickly and fixing the bug. |
Hello!
first of all: nice crate. It really fits my needs.
I found that the following code snippet panics with "attempt to add with overflow" (about 50% of the times I run it on my machine):
I guess it only panics sometimes because tinyset internally uses a random number generator.
Side question: Is the random number generator cryptographically secure? If yes, would you consider adding the option (feature) of using an pseudo RNG when security is not a requirement?
The text was updated successfully, but these errors were encountered: