swisspost-evoting-go-poc/pkg/party/transcript.go
saymrwulf d2cfbf291f Ballot carries E2 + plaintext-equality proof, CC-verified
The voter now also submits E2 = Enc(vote, returnCodesPK[0]) and a plaintext-
equality proof that E2 and the ballot's slot 0 encrypt the SAME vote. Every CC
verifies this proof during ballot verification. This is the soundness link that
makes the return code cast-as-intended: a client that encrypts one vote for the
tally and a different one for the return-code channel is rejected, so the code
the CCs compute from E2 necessarily reflects the tallied vote.

- transcript: publish the combined return-codes public key.
- voter stores returnCodePK from the (confidential) card delivery.
- wire: plaintext-equality proof DTO.

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

31 lines
1.4 KiB
Go

package party
import (
"github.com/user/evote/pkg/elgamal"
emath "github.com/user/evote/pkg/math"
"github.com/user/evote/pkg/mixnet"
"github.com/user/evote/pkg/zkp"
)
// PublicTranscript is the append-only bulletin board: everything a remote
// verifier needs to re-check the election, and nothing secret. It is populated
// by the parties as the ceremony proceeds and consumed by the verifier.
type PublicTranscript struct {
ElectionID string
// Setup artifacts.
CCElectionPKs []elgamal.PublicKey // per-CC election public keys
CCSchnorr [][]zkp.SchnorrProof // per-CC Schnorr proofs of key knowledge
EBPublicKey elgamal.PublicKey // electoral board public key
ElectionPK elgamal.PublicKey // combined election public key
ReturnCodePK elgamal.PublicKey // combined return-codes public key (CCs only, no EB)
Primes []string // decimal encodings of the encoding primes
// Tally artifacts.
MixInput *elgamal.CiphertextVector // padded ballot ciphertexts fed to shuffle 0
Shuffles []mixnet.VerifiableShuffle // one per CC + EB
PartialDecrypts []*elgamal.CiphertextVector // partial decryption after each CC
DecryptProofs [][]zkp.DecryptionProof // per-stage decryption proofs
FinalPlaintexts []*emath.GqVector // EB's decrypted messages
Result map[int]int // option index → count
}