Closed kigawas closed 4 years ago
R: RngCore
should work fine because impl<R> RngCore for &'a mut R where R: RngCore+?Sized
https://rust-random.github.io/rand/rand_core/trait.RngCore.html#foreign-impls And similarly https://github.com/zkcrypto/ff/pull/14
There's no reason using Sized here, I'm not a fan of implementing outside
An idiomatic usage would actually be this, although it might make error messages less clear and once I saw some other interaction, not sure all the consequences here. https://github.com/rust-random/rand/issues/908
fn random<R: RngCore + ?Sized>(rng: R) -> Self {
Yes. That's why we need this pr.
Using ?Sized
here enables us to make sure we are passing only one Rng
instance from the top, especially it's easier to implement rand apis requiring ?Sized
(like sample
)
Sorry about the breakage.
New versions of pairing
/ ff
/ ff_derive
have been pushed to fix this.
New versions of
pairing
/ff
/ff_derive
have been pushed to fix this.
Can you take a look at this https://github.com/zkcrypto/group/pull/4 ?
https://github.com/zkcrypto/ff/pull/14