Commit graph

2 commits

Author SHA1 Message Date
bc43c3d3aa Instrument real crypto ops to emit live LaTeX events
The running cryptography now narrates itself. Each headline operation emits a
trace.Event carrying its LaTeX notation plus the actual runtime values, the
instant it executes:

- Ed25519 signature on every inter-party message (envelope.Seal)
- X25519 ECDH key agreement for confidential card delivery (NewSecureChannel)
- ElGamal ballot encryption E1 = (g^r, pk^r·m) with the real r (castBallot)
- Fiat-Shamir challenge e = H(...) mod q (Schnorr proof)
- Bayer-Groth verifiable shuffle C' = {ReEnc_pk(C_π(i))} with N (mix-net)

Ceremony phases set trace phase/party context so events are attributed to the
acting stakeholder and phase. Instrumentation is behind the enabled-check, so
normal runs pay nothing.

Test: a full traced ceremony captures 184 live events across all five headline
kinds, each with non-empty LaTeX and live values, correctly phase/party-tagged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 14:06:08 +02:00
f7cbe4f634 Add multi-party transport-security layer (Rust-signed)
Foundation for the multi-party re-architecture: an authenticated, confidential
message transport between the separate parties of the system.

- identity.go: per-party Ed25519 + X25519 identities and an Ed25519 root CA.
  Certificates are real X.509, but signed through a crypto.Signer shim whose
  Sign() calls the Rust Ed25519 — so x509.CreateCertificate's signature bytes
  are produced in Rust. Verification extracts TBS bytes and calls the Rust
  verifier, never Go's x509 internals. No RSA anywhere.
- envelope.go: signed inter-party messages over an injective length-prefixed
  encoding of all fields; sign/verify via Rust.
- channel.go: X25519 ECDH (Rust) → session key → AES-256-GCM confidential
  payloads.
- bus.go: CA-anchored directory + message router that verifies every request
  and reply signature before delivery (authenticity enforced at the boundary).

Tests cover cert-chain verification (incl. foreign-CA rejection), envelope
tamper rejection, forged-sender rejection at the bus, and secure-channel
round-trip with associated-data binding.

ARCHITECTURE.md documents the parties, the transport, and the message inventory.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 15:02:54 +02:00