ethereum / go-ethereum

Go implementation of the Ethereum protocol
https://geth.ethereum.org
GNU Lesser General Public License v3.0
47.3k stars 20.02k forks source link

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

Open matthiasgeihs opened 1 year ago

matthiasgeihs commented 1 year ago

https://github.com/ethereum/go-ethereum/blob/ec2ec2d08e28571dc189903f743cc3931da254a9/crypto/crypto.go#L175-L180

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 commented 1 year ago

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