Closed jrick closed 2 months ago
This is needed by mixclient which can't import the package from the main module without also having a circular require on the main module. Since it is only (at this point in time) going to be used by the mixing module, it will go under mixing/internal instead. Will be included as part of a future PR.
Code adapted from dcrwallet's internal/uniformprng package, but modified to take any reader as a randomness source. This can be a CSPRNG, or crypto/rand.Reader.
The random reader is required to never panic. This will not be a concern when using crypto/rand on any modern operating system which provides non-blocking kernel entropy through a system call.