From f03df0e6d7d272808c9d27df40bb92716b341d03 Mon Sep 17 00:00:00 2001 From: Jonas Nick Date: Tue, 17 Dec 2019 17:05:42 +0000 Subject: [PATCH] Define valid ECDSA keys in the documentation of seckey_verify --- include/secp256k1.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/secp256k1.h b/include/secp256k1.h index 816374a4674fd..785525b67c2e9 100644 --- a/include/secp256k1.h +++ b/include/secp256k1.h @@ -552,6 +552,11 @@ SECP256K1_API int secp256k1_ecdsa_sign( ) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4); /** Verify an ECDSA secret key. + * + * A secret key is valid if it is not 0 and less than the secp256k1 curve order + * when interpreted as an integer (most significant byte first). The + * probability of choosing a 32-byte string uniformly at random which is an + * invalid secret key is negligible. * * Returns: 1: secret key is valid * 0: secret key is invalid