File tree Expand file tree Collapse file tree
mithril-common/src/crypto_helper Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,6 +50,16 @@ impl Ed25519Signer {
5050
5151 /// [Ed25519Signer] non deterministic
5252 pub fn create_non_deterministic_signer ( ) -> Self {
53+ // `rand_core`'s `OsRng` was removed and replaced by `getrandom::SysRng`. `OsRng` was
54+ // a wrapper around `getrandom` internally so the functionality does not change.
55+ // `SysRng` reads from the same OS entropy sources as before (e.g. the `getrandom`
56+ // syscall on Linux, `ProcessPrng` on Windows, `getentropy` on macOS) under
57+ // the same documented security guarantee.
58+ //
59+ // `SysRng` only implements the fallible `TryRng`/`TryCryptoRng` (an OS entropy call can,
60+ // in principle, fail). `UnwrapErr` makes `SysRng` Infallible to fit the `generate` bounds.
61+ // It can panic on failure in the same way `OsRng` did so the chance of failure stays the
62+ // same.
5363 let rng = UnwrapErr ( SysRng ) ;
5464 Self :: create_test_signer ( rng)
5565 }
You can’t perform that action at this time.
0 commit comments