mimblewimble / rust-secp256k1-zkp

ZKP fork for rust-secp256k1, adds wrappers for range proofs, pedersen commitments, etc
Creative Commons Zero v1.0 Universal
56 stars 51 forks source link

refactor: revert to use thread_rng instead of RngCore for neater code #29

Closed garyyu closed 5 years ago

garyyu commented 5 years ago

Comments of 2nd update:

After reading more documents, I prefer switch to fill() or gen() instead of fill_bytes(). The related Rand document:

  1. https://docs.rs/rand/0.5.5/rand/trait.Rng.html

    Trait rand::Rng An automatically-implemented extension trait on RngCore providing high-level generic methods for sampling values and other convenience methods. This is the primary trait to use when generating random values.

fill_bytes() comes from RngCore but fill() and gen() comes from Rng.

  1. https://docs.rs/rand/0.5.5/rand/trait.RngCore.html

    End users should normally use Rng from the rand crate, which is automatically implemented for every type implementing RngCore.

garyyu commented 5 years ago

Just saw the conflicts, fixed now. Ready for merge.