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

SecretKey::default is an invalid secret key #830

Closed
segfault-magnet opened this issue Sep 19, 2024 · 2 comments · Fixed by #845
Closed

SecretKey::default is an invalid secret key #830

segfault-magnet opened this issue Sep 19, 2024 · 2 comments · Fixed by #845
Assignees
Labels
bug Something isn't working

Comments

@segfault-magnet
Copy link
Contributor

Reproduction

        let default_secret_key = SecretKey::default();
        let message = Message::from_bytes([0; 32]);

        // panics with:
        // SecretKey is guaranteed to be valid: Error
        Signature::sign(&default_secret_key, &message);
@segfault-magnet segfault-magnet added the bug Something isn't working label Sep 19, 2024
@rymnc
Copy link
Member

rymnc commented Sep 30, 2024

looking into this. can reproduce.

@rymnc
Copy link
Member

rymnc commented Sep 30, 2024

you should use the random feature of fuel-vm and instead use SecretKey::random() to generate an arbitrary secret key. If you wish for some determinism, then perhaps try using a non-zero static key :)

@rymnc rymnc closed this as completed in #845 Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants