Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gitrandom_or_panic #98

Merged
merged 4 commits into from
Nov 28, 2023
Merged

gitrandom_or_panic #98

merged 4 commits into from
Nov 28, 2023

Conversation

burdges
Copy link
Collaborator

@burdges burdges commented Nov 21, 2023

We'll see if CI likes this..

@burdges burdges requested a review from koute November 28, 2023 09:42
Copy link
Collaborator

@koute koute left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Although perhaps a better approach would be to just nuke/simplify this completely and have the user always explicitly pass an RNG? (so, e.g. delete the generate() and only leave the generate_with)

@burdges
Copy link
Collaborator Author

burdges commented Nov 28, 2023

We'll eventually fix the multi-signature stuff and then system randomness really matters. If we let folks derandomize this too easily, then we'd possible end up with ecosystem tooling that depends upon derandomized signatures.

@burdges burdges merged commit 4ee7953 into master Nov 28, 2023
9 checks passed
@tomaka
Copy link

tomaka commented Dec 11, 2023

Although perhaps a better approach would be to just nuke/simplify this completely and have the user always explicitly pass an RNG? (so, e.g. delete the generate() and only leave the generate_with)

I agree with this.

If we let folks derandomize this too easily

People who aren't sure what they're doing will simply do something like generate_with(rand::random()), which is fine. The easy way is already the secure way.
Someone who intentionally makes the effort to use a non secure PRNG will also probably use generate_with anyway.

@burdges
Copy link
Collaborator Author

burdges commented Dec 12, 2023

Ain't worried about key generation here. We still envision doing multi-signatures properly, but multi-signatures break completely without system randomness, because they must generate their nonce without full information. It's this line specifically: https://github.com/w3f/schnorrkel/blob/master/src/musig.rs#L490

I originally imposed this everywhere because I figured air gapped signers would never catch up on multisignatures otherwise. That was maybe heavy handed, but maybe not. It stoped a few people doing dumb shit like signing form the runtime too. I flaged a case where someone was using bad randomness in ECDSA too. Requiring system randomness is not currently one of the decissions in schnorrkel which I regret. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants