Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

ursa crashes on seed lenght shorter than 32 bytes for secp256k1 #213

Open
Erigara opened this issue Aug 25, 2022 · 0 comments
Open

ursa crashes on seed lenght shorter than 32 bytes for secp256k1 #213

Erigara opened this issue Aug 25, 2022 · 0 comments
Labels
enhancement New feature or request security
Milestone

Comments

@Erigara
Copy link
Contributor

Erigara commented Aug 25, 2022

Ursa crashes if seed length is less than 32 bytes for secp256k1, but other algorithms work fine with this seed.

The problem seems to be that in other cases the input seed is hashed before being passed to the rng generator.

Minimal example that reproduce issue

use ursa::{
    keys::KeyGenOption,
    signatures::{
        secp256k1::EcdsaSecp256k1Sha256,
        SignatureScheme,
    },
};

fn main() {
    let options = KeyGenOption::UseSeed(vec![1, 2, 3]);
    let key_pair = EcdsaSecp256k1Sha256::new().keypair(Some(options));
    println!("{:?}", key_pair);
}
@brentzundel brentzundel added security enhancement New feature or request labels Feb 1, 2023
@brentzundel brentzundel added this to the v1.0 milestone Feb 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request security
Development

No branches or pull requests

2 participants