Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
secp256k1: Require concerete rand for privkey gen.
This modifies the recently added GeneratePrivateKeyFromRand function to require a concrete reader for the rand parameter instead of accepting nil and defaulting to crypto/rand.Reader. The primary motivation is to remove the otherwise unnecessary branch in the private key generation. The caller can easily pass in crypto/rand.Reader if desired, or even better, just use GeneratePrivateKey instead since it already does exactly that. In other words, accepting nil doesn't provide any additional functionality that isn't already easily accomplished and it comes at the expense of an otherwise unnecessary branch.
- Loading branch information