swisspost-evoting-go-poc/pkg/party
saymrwulf 127ae61d11 Cast-as-intended return codes: CC extraction + voter check
The return code the voter checks is now genuinely computed by the CCs from the
submitted ciphertext, not looked up from the card:

- returncode_extract.go: after a ballot is accepted, the server asks each CC to
  exponentiate E2 by its return-code key (product over CCs = Enc(vote^Σk)), then
  each CC contributes a partial-decryption factor; the server recovers vote^Σk,
  which equals the card base prime_sel^Σk, and looks up the short code.
- The server returns that code to the voter, who checks it against the card for
  the chosen option; a mismatch aborts with a clear error.

Soundness test: a malicious client that encrypts option A for the tally (E1) but
option B in the return-code channel (E2) is REJECTED by the plaintext-equality
proof — so the code shown always reflects the tallied vote. This closes the
cast-as-intended gap (the old return codes were decorative, finding F16).

Card lCC now uses a fixed tau so extraction can recompute it without learning
the option up front.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 15:52:30 +02:00
..
ceremony.go Voting cards: distributed return-code generation + confidential delivery 2026-07-06 15:15:38 +02:00
ceremony_test.go Add party layer scaffolding: PKI bootstrap + signed handshake 2026-07-06 15:07:31 +02:00
codes.go Cast-as-intended return codes: CC extraction + voter check 2026-07-06 15:52:30 +02:00
codes_test.go Voting cards: distributed return-code generation + confidential delivery 2026-07-06 15:15:38 +02:00
e2e_test.go Tally + verification: full multi-party ceremony runs end-to-end 2026-07-06 15:23:56 +02:00
parties.go Voting cards: distributed return-code generation + confidential delivery 2026-07-06 15:15:38 +02:00
phases.go Cast-as-intended return codes: CC extraction + voter check 2026-07-06 15:52:30 +02:00
returncode_extract.go Cast-as-intended return codes: CC extraction + voter check 2026-07-06 15:52:30 +02:00
setup.go Ballot carries E2 + plaintext-equality proof, CC-verified 2026-07-06 15:47:53 +02:00
setup_test.go Distributed key generation over signed transport + validated wire layer 2026-07-06 15:11:34 +02:00
state.go Ballot carries E2 + plaintext-equality proof, CC-verified 2026-07-06 15:47:53 +02:00
tally.go Tally + verification: full multi-party ceremony runs end-to-end 2026-07-06 15:23:56 +02:00
transcript.go Ballot carries E2 + plaintext-equality proof, CC-verified 2026-07-06 15:47:53 +02:00
verify.go Tally + verification: full multi-party ceremony runs end-to-end 2026-07-06 15:23:56 +02:00
voting.go Cast-as-intended return codes: CC extraction + voter check 2026-07-06 15:52:30 +02:00
voting_test.go Cast-as-intended return codes: CC extraction + voter check 2026-07-06 15:52:30 +02:00
wire.go Ballot carries E2 + plaintext-equality proof, CC-verified 2026-07-06 15:47:53 +02:00