-
Notifications
You must be signed in to change notification settings - Fork 20
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 UniRng
a random scalar generator
#130
Conversation
d9bbd4a
to
32f7337
Compare
47a9944
to
300e852
Compare
Resolves: #129 Co-authored-by: Victor Lopez <[email protected]>
300e852
to
720b3da
Compare
/// let _scalar = BlsScalar::random(rng); | ||
/// ``` | ||
#[derive(Clone, Copy, Debug, Default)] | ||
pub struct UniScalarRng<R>(R); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned on the JubJub PR, I think adding a new RNG will increase type complexity & degradate performance (i.e. we need to copy the numbers into an array, and then read the numbers from the same array to generate a scalar). I suggest just adding it as a function of the scalar
After extensive discussions we decided to not change the random scalar generation because it was deemed secure enough for our purposed: We will use this paper to determine whether the current implementation of the random scalar implementation as done in the In the current implementation of For
and
To check whether the above approach is secure, we do the following: For
This leads to:
and
Now we can check whether:
This clearly holds true, which means that we fall in the first conversion of the paper above, and can safely sample an element from the field over This concludes that we don't need to make any adjustments to the current implementation of random scalar generation. |
Resolves: #129