@@ -400,11 +400,20 @@ SECP256K1_API int secp256k1_ecdsa_signature_parse_compact(
400400 * inputlen: the length of the array pointed to be input
401401 *
402402 * This function will accept any valid DER encoded signature, even if the
403- * encoded numbers are out of range.
403+ * encoded numbers are out of range. This function enforces DER encoding
404+ * strictly, i.e., invalidly encoded signatures will be rejected.
404405 *
405406 * After the call, sig will always be initialized. If parsing failed or the
406407 * encoded numbers are out of range, signature validation with it is
407408 * guaranteed to fail for every message and public key.
409+ *
410+ * Note:
411+ * A parsing function which allows deviations from strict DER encoding is not
412+ * part of this API. A standalone C implementation of non-strict DER parsing
413+ * of ECDSA transactions (as for example present in historical blocks of the
414+ * Bitcoin blockchain) of ECDSA signatures can be found for example in the
415+ * Bitcoin Core project, see the function ecdsa_signature_parse_der_lax in
416+ * https://github.com/bitcoin/bitcoin/blob/master/src/pubkey.cpp .
408417 */
409418SECP256K1_API int secp256k1_ecdsa_signature_parse_der (
410419 const secp256k1_context * ctx ,
@@ -562,6 +571,13 @@ SECP256K1_API int secp256k1_ecdsa_sign(
562571 * 0: secret key is invalid
563572 * Args: ctx: pointer to a context object (cannot be NULL)
564573 * In: seckey: pointer to a 32-byte secret key (cannot be NULL)
574+ *
575+ * Note:
576+ * A function to parse a DER encoded secret key is not part of this API but
577+ * a standalone C implementation of non-strict DER parsing of secret keys can
578+ * be found for example in the Bitcoin Core project, see
579+ * the function ec_seckey_import_der in
580+ * https://github.com/bitcoin/bitcoin/blob/master/src/key.cpp .
565581 */
566582SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_seckey_verify (
567583 const secp256k1_context * ctx ,
0 commit comments