-
Notifications
You must be signed in to change notification settings - Fork 53
update most code to rand 0.9 #8828
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
Conversation
Created using spr 1.3.6-beta.1
@@ -129,7 +129,7 @@ pub fn create_pkgs( | |||
let shares = rack_secret.split(threshold, total_shares)?; | |||
let share_digests = share_digests(&shares); | |||
let mut salt = [0u8; 32]; | |||
OsRng.fill_bytes(&mut salt); | |||
OsRng.try_fill_bytes(&mut salt).expect("fetched random bytes"); |
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.
This is fine, but I'm curious why you changed it.
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.
rand 0.9 no longer has OsRng be infallible (previously it would panic internally, now the error is bubbled up so we get to panic lmao)
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.
Ok, and you wanted to make 0.8 work the same as 0.9 in the codebase. And the failure mode seems better. Thanks!
RackSecret { | ||
secret: SecretBox::new(Box::new(Scalar::random(&mut rng))), | ||
secret: SecretBox::new(Box::new( | ||
Scalar::from_bytes_mod_order_wide(&scalar_bytes), |
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.
Same here. Why the change if we are using the same rand version (0.8.5) ?
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.
I was trying to switch this over to rand 0.9 but unfortunately failed, haha. Reverted this change.
Created using spr 1.3.6-beta.1
With this PR, almost all code now uses rand 0.9. The only exception is the bootstore which uses vsss-rs (and which I believe will be going away at some point).