forked from forks/go-ethereum
crypto: add comment to FromECDSAPub (#31241)
closes https://github.com/ethereum/go-ethereum/issues/26240
This commit is contained in:
parent
a0e6381c48
commit
fbe0005070
1 changed files with 3 additions and 0 deletions
|
|
@ -184,6 +184,9 @@ func UnmarshalPubkey(pub []byte) (*ecdsa.PublicKey, error) {
|
|||
return &ecdsa.PublicKey{Curve: S256(), X: x, Y: y}, nil
|
||||
}
|
||||
|
||||
// FromECDSAPub converts a secp256k1 public key to bytes.
|
||||
// Note: it does not use the curve from pub, instead it always
|
||||
// encodes using secp256k1.
|
||||
func FromECDSAPub(pub *ecdsa.PublicKey) []byte {
|
||||
if pub == nil || pub.X == nil || pub.Y == nil {
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue