Expand description
v16 proof-CWT wire support — canonical parser, replay admission, response binding.
This module implements the hs-rpc-proof-v1 profile: a CWT claims set
(RFC 8392) signed as a COSE object (RFC 9052) that proves one RPC request’s
integrity, freshness, credential binding, and response binding.
The wire contract is the frozen gate-2 CDDL at
docs/standards/v16/hyprstream-proof-cwt.cddl and the private-label
registry at docs/standards/v16/private-label-registry.md. Canonical test
vectors are in docs/standards/v16/vectors/.
§Layout
claims— proof CWT claims-set types and bounded CBOR decode.enrollment— per-entry enrolled signer-suite resolution for authenticated and response proofs.plan— canonical signature-plan types and validation.policy— generated per-method signature policy (suite, disposition, approver threshold) resolved for the decoded leaf.parser— bounded COSE object parse, header/critvalidation, and proof-vector decode.- [
replay] — replay admission store, partitioned by disposition. challenge— rotating server challenge for unattributed proofs.response— response proof binding types.
Re-exports§
pub use crate::envelope::MAX_SERVICE_DOMAIN_BYTES;
Modules§
- admission
- Proof replay admission and challenge manager wiring.
- build
- Authenticated request-proof CWT production for the frozen v16 WNS profile.
- cbor_
audit - Raw-byte CBOR deterministic-encoding audit.
- challenge
- Server challenge protocol for unattributed proofs.
- claims
- Proof CWT claims-set types and bounded deterministic-CBOR decode.
- enrollment
- Per-entry enrollment resolution for authenticated proofs.
- parser
- Bounded COSE object parser for the proof-CWT profile.
- plan
- Canonical signature-plan types — the signed description of every logical signer group and its components.
- policy
- Generated per-method signature policy (§4.4, §5.2).
- recipient_
binding - Holder-proof binding for the two untrusted-rendezvous KEM recipients.
- response
- Response binding types — the client’s commitment to how the response must be produced.
- verify
- COSE signature verification for proof CWTs.
Enums§
- Proof
Disposition - Disposition of a proof relative to credential presence. Determines the replay key and partition.
- Proof
Kind - The kind of proof, determined by which
typ/hs_domainpair it carries.
Constants§
- ALG_
ED25519 - ALG_
ML_ DSA_ 65 - ALG_
ML_ KEM_ 768 - Interim project-private COSE algorithm ID for the ML-KEM-768 response
recipient (Gate-2 amendment 5:
hs-kem-ml-kem-768-v1 = -70200). This is enforced exactly; a future registered COSE value is an explicit incompatible profile revision, not a silent alternative. - CLAIM_
CAPNP_ BODY_ BYTES - CLAIM_
CAPNP_ SCHEMA_ ID - CLAIM_
CREDENTIAL_ HASH - CLAIM_
FEDERATE_ RECIPIENT_ BINDING - Deferred-Federate-only source extension binding every forwarded response recipient. Generic proof parsing rejects it; it is not in the frozen public v16 registry.
- CLAIM_
RESPONSE_ BINDING - COSE_
HEADER_ ALG - COSE_
HEADER_ CRIT - COSE_
HEADER_ KID - COSE_
HEADER_ TYP - CREDENTIAL_
HASH_ SIZE - Credential hash size in bytes (SHA-256).
- CWT_
CLAIM_ AUD - CWT_
CLAIM_ CTI - CWT_
CLAIM_ EXP - CWT_
CLAIM_ IAT - CWT_
CLAIM_ NONCE - HEADER_
HS_ DOMAIN - HEADER_
HS_ LOGICAL_ SIGNER_ GROUP - HEADER_
HS_ SIGNATURE_ PLAN - HEADER_
HS_ UNATTRIBUTED_ KEY_ SET - MAX_
BODY_ BYTES - Maximum Cap’n Proto body bytes signed by the proof.
- MAX_
CHALLENGE_ BYTES - Maximum server-challenge size in bytes.
- MAX_
CLOCK_ SKEW_ SECS - W1 (design §4.5) verifier-clock freshness bounds. All three are
VERIFIER-CLOCK bounds, never issued lifetime (
exp - iat): a proof is fresh iff|iat - now| <= MAX_CLOCK_SKEW_SECS,now < exp, andexp - nowis within the disposition maximum. - MAX_
COMPONENTS_ PER_ GROUP - Maximum components per signer group.
- MAX_
COSE_ OBJECT_ BYTES - Maximum total encoded COSE object size.
- MAX_
KID_ BYTES - Maximum bytes for a key ID.
- MAX_
REMAINING_ LIFETIME_ AUTHENTICATED_ SECS - Maximum remaining lifetime for an authenticated (credential-bound) proof.
- MAX_
REMAINING_ LIFETIME_ UNATTRIBUTED_ SECS - Maximum remaining lifetime for an unattributed (self-asserted) proof.
- MAX_
SIGNATURE_ ENTRIES - Maximum signature entries per proof.
- MAX_
SIGNER_ GROUPS - Maximum signer groups per plan.
- MAX_
SIGNER_ GROUP_ ID - Ceiling on the
hs_logical_signer_groupvalue (Gate-2 amendment 6:uint .le 255). A group ID above this denies at parse time. - MAX_
SUITE_ ID_ BYTES - Maximum encoded bytes for a suite ID.
- MIN_
CHALLENGE_ BYTES - Minimum server-challenge size in bytes.
- PROOF_
TYP - Media type for the request-proof CWT (RFC 6838 vendor tree,
+cwtsuffix). - REQUEST_
ID_ SIZE - Request ID size in bytes (CWT
cti). - REQUEST_
PROOF_ DOMAIN - Cryptographic domain separator for request proofs — inside every
Sig_structure. - RESPONSE_
PROOF_ DOMAIN - Cryptographic domain separator for response proofs.
- RESPONSE_
PROOF_ TYP - Media type for the response-proof CWT.
- SUITE_
CLASSICAL - Versioned suite ID for standalone Ed25519.
- SUITE_
HYBRID - Versioned suite ID for the weakly-non-separable Ed25519 + ML-DSA-65 hybrid.
Functions§
- is_
proof_ typed_ credential - Whether
presentedis a request- or response-proof CWT rather than a credential.
Type Aliases§
- Credential
Hash - SHA-256 credential hash.
- Request
Id - A 128-bit request identifier — the CWT
cticlaim.