Skip to content

Make all non-test randomness user-provided #95

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sipa
Copy link
Collaborator

@sipa sipa commented May 13, 2025

Instead of relying on the C++ std::random_device and std::uniform_int_distribution (which lack strong quality guarantees), move the responsibility for generating good randomness to the user.

All constructors and functions related to sketch construction are modified to take in an explicit uint64_t seed value. The test code still uses the C++ randomness functions.

Fixes #93.

@sipa sipa force-pushed the 202505_feedrand branch from 12fc549 to ad21816 Compare May 13, 2025 18:07
@sipa sipa force-pushed the 202505_feedrand branch from ad21816 to 9629438 Compare May 13, 2025 18:09
@gmaxwell
Copy link
Contributor

Maybe the API doc ought to continue to say that the seed is just to limit the ability of malicious input to intentionally cause worst case operating time? -- just so the caller doesn't worry to much about it and also so they know that they probably shouldn't let a third party pick the value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proper Initialization of SketchImpl
2 participants