Skip to content

Commit f48dfc4

Browse files
MariusVanDerWijdenjakub-freebit
authored andcommitted
crypto: add comment to FromECDSAPub (ethereum#31241)
closes ethereum#26240
1 parent c012e84 commit f48dfc4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crypto/crypto.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ func UnmarshalPubkey(pub []byte) (*ecdsa.PublicKey, error) {
184184
return &ecdsa.PublicKey{Curve: S256(), X: x, Y: y}, nil
185185
}
186186

187+
// FromECDSAPub converts a secp256k1 public key to bytes.
188+
// Note: it does not use the curve from pub, instead it always
189+
// encodes using secp256k1.
187190
func FromECDSAPub(pub *ecdsa.PublicKey) []byte {
188191
if pub == nil || pub.X == nil || pub.Y == nil {
189192
return nil

0 commit comments

Comments
 (0)