From e2290f9f48e5673b243526a941a230895a3c24e3 Mon Sep 17 00:00:00 2001 From: Ferdinando Ametrano Date: Tue, 8 Sep 2026 16:07:59 +0200 Subject: [PATCH] ecdsa_sigformat: note conversions canonicalize S to low-S The four converters call secp256k1_ecdsa_signature_normalize, so a high-S signature does not round-trip byte-for-byte through them. Document this in the module header, which otherwise reads as pure format conversion. --- src/electrum_ecc/ecdsa_sigformat.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/electrum_ecc/ecdsa_sigformat.py b/src/electrum_ecc/ecdsa_sigformat.py index 893b056..28b0006 100644 --- a/src/electrum_ecc/ecdsa_sigformat.py +++ b/src/electrum_ecc/ecdsa_sigformat.py @@ -8,6 +8,8 @@ # This is a variable length (around 71-73 bytes) serialized format. # - "r and s": A tuple of integers (r, s). # This module contains helper functions to convert between these. +# These conversions canonicalize the signature to low-S, so a high-S +# signature does not round-trip byte-for-byte. from typing import Tuple from ctypes import (