Skip to content

docs(signing): cite the RFC 9421 section that defines ECDSA P-256 - #252

Merged
damaz91 merged 1 commit into
Universal-Commerce-Protocol:mainfrom
vishkaty:fix/rfc9421-ecdsa-section-citation
Oct 19, 2026
Merged

damaz91 merged 1 commit into
Universal-Commerce-Protocol:mainfrom
vishkaty:fix/rfc9421-ecdsa-section-citation

Conversation

@vishkaty

Copy link
Copy Markdown
Contributor

The ucp_signing.py module docstring attributes the fixed-width raw r||s rule for
ECDSA P-256 to RFC 9421 Section 3.3.1. That section is RSASSA-PSS Using SHA-512.
ECDSA using curve P-256 and SHA-256 is Section 3.3.4, and it is the section that
defines the encoding this module implements: r and s "encoded as big-endian
unsigned integers, zero-padded to 32 octets each", concatenated into a 64-octet array.

The substance of the line was already right and the code matches it. _EC_CURVES maps
P-256 to ("ES256", 32) and the verifier rebuilds a DSS signature from the two
32-byte halves. Only the section number was wrong. For completeness the sibling P-384
rule is Section 3.3.5 and EdDSA over edwards25519 is Section 3.3.6; the line cites
RFC 8032 for Ed25519, which is correct and unchanged.

Swept the repo for the class: this is the only Section 3.3.x citation in any .py,
.ts, .js or .md file. The Node twin at rest/nodejs/src/utils/signature.ts cites
Section 2.2.3 for authority normalisation, which is correct, and no 3.3.x section.

The UCP specification carries the same number at signatures.md Signature Encoding,
which is where this docstring took it from when the module was written. That is a
separate fix in the spec repo.

Gates: uv sync --directory rest/python/server/ rc 0; uv run --directory rest/python/server pytest 279 passed, 12 subtests passed, rc 0; ruff check and
ruff format --check at the pre-commit pin 0.14.13 both rc 0.

The ucp_signing.py module docstring attributes the fixed-width raw r||s
rule for ECDSA P-256 to RFC 9421 Section 3.3.1. That section is RSASSA-PSS
Using SHA-512. ECDSA using curve P-256 and SHA-256 is Section 3.3.4, and
it is the section that defines the encoding the module implements: r and s
"encoded as big-endian unsigned integers, zero-padded to 32 octets each",
concatenated into a 64-octet array.

The substance of the line was already right and the code matches it:
_EC_CURVES maps P-256 to ("ES256", 32) and the verifier rebuilds a DSS
signature from the two 32-byte halves. Only the section number was wrong.

For completeness, the sibling P-384 rule is Section 3.3.5 and EdDSA over
edwards25519 is Section 3.3.6; the line cites RFC 8032 for Ed25519, which
is correct and unchanged.

The same wrong section number appears in the UCP specification at
signatures.md Signature Encoding, which is where this docstring took it
from. That is a separate fix in the spec repo.

Swept the repo for the class: this was the only Section 3.3.x citation in
any .py, .ts, .js or .md file. The Node twin in rest/nodejs/src/utils/
signature.ts cites Section 2.2.3 for authority normalisation, which is
correct, and no 3.3.x section.

Gates: uv sync rc 0; uv run --directory rest/python/server pytest 279
passed, 12 subtests passed, rc 0.
@damaz91 damaz91 added status:needs-triage Signal that the PR is ready for human triage status:under-review and removed status:needs-triage Signal that the PR is ready for human triage labels Oct 13, 2026
@damaz91
damaz91 merged commit ce3f571 into Universal-Commerce-Protocol:main Oct 19, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants