Commit graph

9 commits

Author SHA1 Message Date
b38b990bc4 Add evote cockpit --tmux: one terminal pane per stakeholder
The terminal systems-view half of the cockpit, fed by the SAME trace stream as
the browser math view — no double-maintenance.

- cockpit_tmux.go: spawns a tmux session with one pane per stakeholder (setup,
  CC0–CC3, electoral board, voting server, verifier, and an aggregate voters
  pane), each running `evote panelview`. The ceremony runs in the background,
  appending paced NDJSON events to a shared temp file the panes tail. Guards for
  missing tmux and for being run inside an existing tmux session.
- panelview.go: a hidden subcommand each pane runs — follows the shared event
  file, filters to its stakeholder, and renders that party's operations as
  colored ASCII/Unicode math with elided live values.
- Attribute setup-phase Schnorr challenges to the generating CC and verify-phase
  challenges to the verifier (trace.SetContext), so every pane gets its ops.

Verified: panelview filters and renders correctly per role; a 9-pane tiled tmux
session builds with the real pane commands. (Interactive attach needs a TTY, so
the live attach is exercised when you run it.)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 15:43:05 +02:00
1e0b286bd5 Add evote cockpit: watch the cryptography execute as live typeset math
The differentiator. A single self-contained browser page (no libraries, offline)
renders each real cryptographic operation as typeset mathematics the instant it
runs, with the actual runtime values:

- E_1 = (γ, φ) = (g^r, pk^r·m),  r ← Z_q      (ElGamal ballot encryption)
- e = H((p,q,g), y, c, h_aux) mod q            (Fiat-Shamir challenge)
- C' = { ReEnc_pk(C_π(i); ρ_i) }              (Bayer-Groth verifiable shuffle)
- σ ← Ed25519.Sign_sk(SHA256(envelope))        (transport signature)
- s = a·B = b·A ∈ X25519,  k = SHA256(…)      (X25519 key agreement)

Math is rendered via a focused LaTeX→native-MathML converter written for exactly
the notation the instrumentation emits — so it works in any modern browser with
zero dependencies and nothing to ship. Unknown tokens fall back to literal text,
never crashing the view.

`evote cockpit` starts an HTTP server; on page connect it runs one full multi-
party ceremony, streaming every crypto event over SSE with configurable pacing
(--delay) so a human can follow along. A stakeholder sidebar highlights the
acting party; a phase timeline tracks setup→cards→voting→tally→verify; each op
shows its live values as expandable, copyable chips.

Verified in a real browser: all five operation kinds render correctly (96 sign,
36 challenge, 6 keyex, 2 encrypt, 5 shuffle in a 2-voter run), no console errors,
ceremony completes and verifies.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 14:19:13 +02:00
cad6e112e3 Docs: fix remaining stale LOC claims in index.html manual + swe title
The final stale-claim sweep caught index.html's embedded operations manual
(intro paragraph + comparison table still said ~6,500 lines / no-RSA row missing)
and the swe deck title. Update both, add the signatures/key-exchange row to the
index comparison table, and re-sync the root standalone decks. Repo-wide sweep
for stale claims is now clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 19:17:58 +02:00
259bcc2f1e index.html: reflect multi-party mode + updated deck metadata
Landing cards now mention the multi-party re-architecture, Rust transport layer,
and cast-as-intended, with corrected slide counts. Operations manual: replace
the 'no network / same machine' framing with the netdemo trust-boundary
explanation, update prerequisites (Go 1.25 + Rust, make build), and fix the
'no network access required' line (netdemo's signed transport runs in-process).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 19:12:06 +02:00
3f45439dbe crypto.html: add cast-as-intended + transport-crypto slides
New Part IV½ shows the return-code cast-as-intended mechanism (E2 + plaintext-
equality proof, CC exponentiation + joint decryption) and the transport-security
layer (Ed25519/X25519, Ed25519 X.509 PKI, implemented in Rust) — so the deck's
existing "cast-as-intended" claim is now backed by the actual construction.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 19:09:43 +02:00
583d09a410 swe.html: add Part VI½ on the multi-party re-architecture
New section covers splitting the parties, the Rust transport-security layer
(Ed25519/X25519 over cgo, no RSA), the validated wire boundary, and cast-as-
intended return codes. Also corrects the error-handling slide (the netdemo mode
does cross a real trust boundary) and notes the Rust dependency on the deps
slide. Verified: deck serves 200 and the script balances.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 19:07:59 +02:00
b1f56065ed Add evote netdemo: run the multi-party ceremony from the CLI
New subcommand runs the entire election as separate parties over the
Rust-signed transport, printing per-phase progress and the verified message
count. --verbose logs every signed envelope (from -> to : type, signature OK).
--voters/--options are validated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 15:25:18 +02:00
ec4be74e17 Due-diligence hardening + Rust transport-security layer
Correctness/security review of the whole PoC, with fixes and regression tests.

Cryptographic soundness:
- mixnet: enforce the multi-exponentiation c_{B_m}=commit(0;0) check that was
  stubbed out with an empty if — without it a malicious mixer can prove a
  non-permutation shuffle.
- zkp: derive all four Fiat-Shamir challenges via RecursiveHashToZq instead of
  a biased `hash mod q` (which also capped the challenge space at 256 bits for
  production-sized groups).

Verification honesty:
- protocol: VerifyTally now actually calls zkp.VerifySchnorrProof and returns
  the true aggregate result instead of an unconditional true.
- protocol: persist the padded mix input (event.MixInput) so the verifier checks
  shuffle 0 against the same padding the tally used (fixes false INVALID for N<2).

Other correctness:
- kdf: length-prefix BuildKDFInfo parts so the info encoding is injective.
- math: GqElementFromSquareRoot accepts the valid root q (off-by-one that could
  panic in HashAndSquare); RandomGqElement samples the full canonical range.
- cmd: validate demo --voters/--options instead of panicking on degenerate values.
- protocol: use crypto/rand in the demo driver (drop the last math/rand import).

Transport security (new): pkg/transportsec exposes Ed25519 signatures and X25519
ECDH — implemented in Rust (rust/transportsec: ed25519-dalek, x25519-dalek),
linked into Go via cgo. No RSA. Cross-language conformance test proves the Rust
Ed25519 signatures interoperate with Go's crypto/ed25519. Makefile builds the
Rust static lib before the Go binary.

Tests: added unit/round-trip/tamper coverage for math, hash, elgamal, zkp,
mixnet, kdf, returncodes, protocol (end-to-end), and the Rust FFI bridge.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 14:42:34 +02:00
e8b6f30871 Swiss Post E-Voting Go PoC
Proof-of-concept reimplementation of the Swiss Post e-voting
cryptographic protocol in Go. Single binary, 52 source files,
2 dependencies. Covers ElGamal encryption, Bayer-Groth verifiable
shuffles, zero-knowledge proofs, return codes, and a full
election ceremony demo.
2026-02-13 19:53:09 +01:00