getrandom_or_panic

Crates.iogetrandom_or_panic
lib.rsgetrandom_or_panic
version0.0.3
sourcesrc
created_at2023-11-21 17:18:34.098482
updated_at2023-11-21 23:53:39.927052
description Implements a RngCore which panics unless getrandom exists
homepage
repositoryhttps://github.com/burdges/getrandom_or_panic
max_upload_size
id1044441
size3,867
Jeff Burdges (burdges)

documentation

https://docs.rs/getrandom_or_panic

README

getrandom_or_panic

Addresses one minor conundrum in cryptography crates:

We want end user signers and provers to dependend directly upon getrandom for system randomness, so that users cannot supply insecure random number generators.

We need verifiers to run in contexts without system randomness though, like block chains.

We'd ideally seperate provers and verifiers using features, but doing so becomes tricky as crates become more complex, and makes insecure backends for getrandom tempting.

Instead, we pretend that system randomness exists to satisfy the compiler, but panic if called without getrandom. You could still provide an insecure getrandom, but now you've been warnned about this footgun.

Commit count: 11

cargo fmt