Skip to content

Commit

Permalink
crypto: add comment to FromECDSAPub (#31241)
Browse files Browse the repository at this point in the history
closes #26240
  • Loading branch information
MariusVanDerWijden authored Feb 24, 2025
1 parent a0e6381 commit fbe0005
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crypto/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fbe0005

Please sign in to comment.