Expand description
Data Integrity proofs and key formats for the language SDKs, as JSON.
The Python reference’s vouch.crypto primitives (data_integrity,
data_integrity_hybrid, multikey, ed25519_check, mldsa_check),
once, with the reference’s behavior: the same checks in the same order,
the same answer (a verdict, or a refusal with the reference’s text). The
language SDKs keep only key objects and the Ed25519 / ML-DSA / SLH-DSA
signing calls; the signing input, the proof shape, the proofValue
encodings, the strict key and signature rules and every verification run
here.
These are the primitives: a proof is checked against the key the caller
names, with no issuer binding. The verifier’s decision
(crate::decision) adds the binding.
One entry, rules_json, {"op": ...} in, JSON out; bytes are standard
base64. A refusal is an Err: CoreError::Crypto for a key or
signature the strict Ed25519 rules refuse (the reference’s
WeakKeyError), CoreError::Json for anything else (ValueError).
Constants§
- ED25519_
SIGNATURE_ SIZE - MAX_
BASE58_ ENCODE_ BYTES - The cryptosuites a proof set can carry, in the order they are written. The most bytes base58Encode writes (an SLH-DSA signature is 7,856).
- MLDS
A44_ PUBLIC_ KEY_ SIZE - MLDS
A44_ SIGNATURE_ SIZE - PROOF_
SET_ SUITES - SLHDS
A128_ PUBLIC_ KEY_ SIZE - SLHDS
A128_ SIGNATURE_ SIZE
Functions§
- attach
- Attach a signature to an unsigned proof of its cryptosuite: base58btc for Ed25519, base64url for ML-DSA-44 and SLH-DSA-SHA2-128s.
- decode_
eddsa_ proof_ value - The 64-byte Ed25519 signature in an eddsa-jcs-2022 proofValue: base58btc (“z”), exactly 64 bytes, and a signature the strict rules accept.
- decode_
mldsa44_ proof_ value - decode_
slhdsa128_ proof_ value - ed25519_
public_ key_ problem - Why the strict rules refuse an Ed25519 public key, or None: not 32 bytes, y >= p, a point of small order, or not a point on the curve.
- ed25519_
signature_ problem - Why the strict rules refuse a 64-byte Ed25519 signature, or None: R not canonical or of small order, or S not below the group order L.
- hash_
data - The 64-byte Data Integrity signing input of
documentunder the unsignedproof(its proofValue, if any, left out). - legacy_
digest - The pre-alignment signing input (one SHA-256 over the document with the unsigned proof attached).
- multikey_
decode - A public-key Multikey’s algorithm and raw key, with the reference’s refusals: only a public-key codec, the algorithm’s exact length, a strict Ed25519 key, an SLH-DSA key in base64url (“u”) and the others in base58btc (“z”).
- multikey_
encode - A raw public key as a Multikey (no strict checks, as the reference).
- paired_
methods - The (ML-DSA-44, SLH-DSA) verificationMethods that pair with an Ed25519
one: the
#key-2and#key-3slots of the same DID. - proof_
suites - The suites of a document’s proof as a verifier counts them: one
eddsa-jcs-2022 proof object is that suite; a proof set (exactly one
eddsa-jcs-2022 proof, at least one post-quantum proof, at most one of
each) is its members’ suites in
PROOF_SET_SUITESorder; else none. - rules_
json - The proof rules,
{"op": ...}in (bytes in standard base64): - rules_
json_ text rules_jsonon a request text that may hold a secret key: the text and every string of the parsed request are wiped once the rule has run.- secret_
multikey_ decode - Read a
secretKeyMultibasevalue: its algorithm and raw secret key, with the reference’s refusals (a public key, an unknown codec, a wrong size). - secret_
multikey_ encode - A secret key as a
secretKeyMultibasevalue: the private-key multicodec and the key, base58btc (“z”) for Ed25519 (the 32-byte seed) and ML-DSA-44 (the 2560-byte packed key), base64url (“u”) for SLH-DSA-SHA2-128s. - unsecured_
document - The document with no
proofmember. - verify_
dual - Verify a proof set of exactly the Ed25519 and the ML-DSA-44 proof.
- verify_
eddsa - Verify the single eddsa-jcs-2022 proof of
documentwithpublic_key. Ok(false) is a signature that does not verify; Err is a malformed proof or a key or signature the strict rules refuse. The pre-alignment signing input is accepted too. - verify_
proof_ set - Verify a proof set: the Ed25519 proof and every post-quantum proof must verify, and a post-quantum proof whose key is not given fails the set.