-
Notifications
You must be signed in to change notification settings - Fork 73
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
Secret seeds and primes #139
Comments
The secrets should be prime. because in wyrand, we add the secret to the seed. a prime secret ensure that the period is 2^64. For other part of wyhash library, it is a "feeling to be perfect". And non-prime secret seem to fail smhasher. |
Miller-Rabin test is done by copying :-) |
The cleaned code for Miller Rabin test is available here https://github.com/wangyi-fudan/MillerRabin64 |
It could be in separate tool/file. I already proposed it with hash map (#120). I don't get why would it have to be in hash itself. If you just mentioned in the hash that secret was generated with function moved to make-secret.c it would be fine and everyone wanting to dig it further would find the tool and used it. May I propose PR #140 that does that. |
First a question - as far as I understand these secret seeds are meant to be primes. Why is that, or where can I read about that?
Now to the point.
You said that secret seeds are more balanced. What you mean by that?
Also checking 2^32 division reminders is rather ineffective. checking 2^64 - 59 took me, literally 99 seconds.
There is this algorithm - Miller-Rabin primality test, that checks it in 1.3 s, and all four wyhash secret's seeds in 1.03 ms, yes millisecond. There is, not only one, example of it here (last C version).
The text was updated successfully, but these errors were encountered: