We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 65efe9d commit f2fb257Copy full SHA for f2fb257
crypto/crypto.go
@@ -184,6 +184,9 @@ func UnmarshalPubkey(pub []byte) (*ecdsa.PublicKey, error) {
184
return &ecdsa.PublicKey{Curve: S256(), X: x, Y: y}, nil
185
}
186
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.
190
func FromECDSAPub(pub *ecdsa.PublicKey) []byte {
191
if pub == nil || pub.X == nil || pub.Y == nil {
192
return nil
0 commit comments