From 9a6200eb603f82ec3a87a242b5f6fe23f6078aa2 Mon Sep 17 00:00:00 2001 From: Diego Garcia Date: Mon, 2 Dec 2024 13:51:18 +0100 Subject: [PATCH] crypto: document errInvalidPubkey error variable --- crypto/crypto.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crypto/crypto.go b/crypto/crypto.go index aaa5cc43a2..59850000ca 100644 --- a/crypto/crypto.go +++ b/crypto/crypto.go @@ -49,7 +49,12 @@ var ( secp256k1halfN = new(big.Int).Div(secp256k1N, big.NewInt(2)) ) -var errInvalidPubkey = errors.New("invalid secp256k1 public key") +var ( + // errInvalidPubkey is returned when an invalid secp256k1 public key is provided. + // This can occur during public key unmarshaling if the provided bytes do not + // represent a valid point on the secp256k1 curve. + errInvalidPubkey = errors.New("invalid secp256k1 public key") +) // EllipticCurve contains curve operations. type EllipticCurve interface {