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

How to obtain public key from a secret key? #14

Closed
devashishdxt opened this issue Mar 19, 2020 · 3 comments
Closed

How to obtain public key from a secret key? #14

devashishdxt opened this issue Mar 19, 2020 · 3 comments

Comments

@devashishdxt
Copy link

I'm not able to find any way to get public key corresponding to any secret key. Is there a way to obtain it?

@tarcieri
Copy link
Member

The relevant mathematical function is fixed-base scalar multiplication.

This project contains a crate-per-elliptic curve, and none of them implement scalar multiplication.

Thus I will leave this issue open, noting @str4d has in fact contributed an immaculately written field arithmetic backend for the NIST P-256 elliptic curve, with the caveat that he purposefully was trying to solve the specific problems of point compression and decompression.

@tarcieri
Copy link
Member

The p256 and k256 crates now both support scalar multiplication.

The next steps here, I think, are to define traits which generically provide access to fixed-base scalar multiplication.

I opened an issue about that here: #22

@tarcieri
Copy link
Member

tarcieri commented Jul 14, 2020

This was fixed in #49.

When the arithmetic backend is enabled for a particular curve, PublicKey::from_secret_key is available.

I might do some refactoring to change that to SecretKey::compressed_public_key() and SecretKey::uncompressed_public_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

2 participants