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

FromECDSAPub: Use curve from input pub instead of fixed S256()? #26240

Closed
matthiasgeihs opened this issue Nov 23, 2022 · 2 comments · Fixed by #31241
Closed

FromECDSAPub: Use curve from input pub instead of fixed S256()? #26240

matthiasgeihs opened this issue Nov 23, 2022 · 2 comments · Fixed by #31241

Comments

@matthiasgeihs
Copy link

func FromECDSAPub(pub *ecdsa.PublicKey) []byte {
if pub == nil || pub.X == nil || pub.Y == nil {
return nil
}
return elliptic.Marshal(S256(), pub.X, pub.Y)
}

pub.Curve may be different from S256(). However, here marshaling is fixed to S256().

This may be problematic if the function is used externally with different curves.

Any thoughts?

@fjl
Copy link
Contributor

fjl commented Nov 24, 2022

We do not support any elliptic curves beyond secp256k1 in package crypto. Probably this information should be added to the documentation.

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

Successfully merging a pull request may close this issue.

3 participants
@fjl @matthiasgeihs and others