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

Call EC_KEY_get_conv_form? #2305

Open
jorgecarleitao opened this issue Sep 19, 2024 · 0 comments
Open

Call EC_KEY_get_conv_form? #2305

jorgecarleitao opened this issue Sep 19, 2024 · 0 comments

Comments

@jorgecarleitao
Copy link

jorgecarleitao commented Sep 19, 2024

Hi, I could not find an interface for EC_KEY_get_conv_form. Specifically, it seems that is not possible today to do something like this:

use openssl::{nid, ec, bn};

fn generate_some_bytes_from_ec() -> Result<Vec<u8>, ErrorStack> {
    let group = ec::EcGroup::from_curve_name(nid::Nid::X9_62_PRIME192V1)?;
    let key = ec::EcKey::generate(&group)?;
    key.public_key()
        .to_bytes(&group, EC_KEY_get_conv_form(&key), bn::BigNumContext::new()?.deref_mut())
}

To my understanding, the form exists in the key.

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

No branches or pull requests

1 participant