Skip to content
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

Add API for unbiased "random numbers" #236

Open
stevew817 opened this issue Jan 6, 2025 · 0 comments
Open

Add API for unbiased "random numbers" #236

stevew817 opened this issue Jan 6, 2025 · 0 comments

Comments

@stevew817
Copy link

There exists a footgun in using raw RNG output when in reality you need a number between x and y with evenly distributed probability. This is called "modulo bias", and a good explanation can be found e.g. over at Kudelski.

Should the PSA Crypto API, which already provides a function to get whole bytes with uniform distribution, be extended with an API that gives an unbiased uniformly-distributed number between x and y?

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

No branches or pull requests

1 participant