Skip to main content

Crate polyc_crypto

Crate polyc_crypto 

Source
Expand description

Provenance signatures for polychrome.

Wraps commonware-cryptography ed25519 so the harness can sign the bytes that back a tool call’s signature field and the control plane can verify them. A fixed NAMESPACE provides cross-domain separation (a signature minted here cannot be replayed in another context).

This primitive is runtime-agnostic — it does not pull in commonware-runtime or commonware-p2p.

Modules§

approval
HITL approval payload encoders/decoders and signer.
approval_assertion
Canonical signing for an approval’s asserted responder (#1553).
canon
Canonical JSON form for approval and mandate args binding.
edge_identity
Canonical signing for edge-identity attribution envelopes.
handoff
Canonical signing for conversation handoff provenance.
hex
Lowercase-hex encoding shared by every signed-artifact module.
mandate
AP2-style pre-authorization mandates: canonical signing plus the chain that narrows them (Intent → Cart → Payment).
question
ask_question (#1660) signed-answer canonical, verification, and the per-question correlation-token contract.
routine_observation
Routine observation handles (#1494).
sensitive
Sensitive<T>: a secret-value wrapper that redacts Debug/Display, never serializes, and zeroizes its contents on drop (#1169).
session
Stateless, signed web-session tokens and their logout denylist.
session_grant
Stateless, signed, DERIVABLE rotation grants for a web-session family.
signing_role
Compile-time separated platform signing roles and public identities.
subagent
Canonical signing for sub-agent delegation provenance (#872).
tls
Shared CA-bundle PEM loading for TLS trust stores.
toolcall
Canonical signing for tool-call provenance.

Structs§

Signer
An ed25519 signing key.

Enums§

SignerError
Raised building a Signer from raw key-material bytes (#784) — e.g. loaded from a secret store — rather than the insecure deterministic Signer::from_seed.

Constants§

NAMESPACE
Domain-separation namespace prepended to every polychrome signature.

Functions§

hash_salted_secret
Compute hex(sha256(salt || secret)).
random_secret_bytes
Mint 32 cryptographically secure random bytes from the operating system’s entropy source.
verify
Verify sig over msg against an encoded public_key.