@algovoi/rfc9421-ecdsa
v0.1.0
Published
ECDSA (P-256/P-384) provider add-on for @algovoi/rfc9421-verifier
Maintainers
Readme
@algovoi/rfc9421-ecdsa
ECDSA (P-256 / P-384) add-on for @algovoi/rfc9421-verifier.
A pure add-on: it does not modify or re-publish the core verifier. It gives
you a drop-in verifyRequest that accepts Ed25519 (delegated verbatim to the
untouched verifier) plus the two RFC 9421-registered ECDSA suites:
ecdsa-p256-sha256(RFC 9421 3.3.5): P-256, SHA-256, 64-byter‖ssignatureecdsa-p384-sha384(RFC 9421 3.3.6): P-384, SHA-384, 96-byter‖ssignature
The ECDSA path reuses the verifier's already-hardened primitives (Signature-Input
parsing, freshness/replay, Content-Digest, signing-base, downgrade/allow-list) and
adds only the ECDSA signature check. The core verifier stays Ed25519-only and
unchanged; this package brings its own @noble/curves dependency.
import { verifyRequest } from "@algovoi/rfc9421-ecdsa";
const result = await verifyRequest({
method: "POST",
authority: "api.example.com",
path: "/a2a",
headers,
body,
publicKey: sec1PointBytes,
allowedAlgorithms: ["ecdsa-p256-sha256"], // opt in per request
});
// Ed25519 requests are delegated to the core verifier automatically.Hardening
Before accepting an ECDSA signature the provider enforces:
- the public-key point is on the curve and not the identity;
- the signature is exactly the curve size (64 / 96 bytes, raw
r‖s, not DER); randsare each in[1, n-1];- optional canonical low-
senforcement (anti-malleability) viasetStrictLowS(true), off by default for spec interop.
Byte-for-byte decision parity with the Python algovoi-rfc9421-ecdsa package,
verified by a cross-implementation differential. Apache-2.0.
