Skip to main content

Module proof

Module proof 

Source
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/crit validation, 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§

ProofDisposition
Disposition of a proof relative to credential presence. Determines the replay key and partition.
ProofKind
The kind of proof, determined by which typ/hs_domain pair 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, and exp - now is 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_group value (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, +cwt suffix).
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 presented is a request- or response-proof CWT rather than a credential.

Type Aliases§

CredentialHash
SHA-256 credential hash.
RequestId
A 128-bit request identifier — the CWT cti claim.