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

Derivation of b unclear #380

Open
jhoyla opened this issue Feb 10, 2023 · 2 comments
Open

Derivation of b unclear #380

jhoyla opened this issue Feb 10, 2023 · 2 comments

Comments

@jhoyla
Copy link
Collaborator

jhoyla commented Feb 10, 2023

In section {#random-scalar} the text reads:

As an optimization, if the group order is very close to a power of 2, it is acceptable to omit the rejection test completely. In particular, if the group order is p, and there is an integer b such that |p - 2b| is less than 2^(b/2), then RandomScalar can simply return a uniformly random integer of at most b bits.

This just reads like magic. It's not obvious how to choose b, or that any value of b satisfying the requirements is valid.

@chris-wood
Copy link
Collaborator

The salient point is that there exists an integer b such that the condition holds. We could add more explanation about why this is sufficient, but I'm inclined to not burden the reader with that.

@armfazh
Copy link
Collaborator

armfazh commented Feb 23, 2023

does it help to mention that p is a b-bit integer?

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

3 participants