mirror of
https://github.com/saymrwulf/swisspost-evoting-go-poc.git
synced 2026-09-04 20:23:55 +00:00
pkg/party models each endpoint of the system as a separate object holding only its own private state, wired together through the transport bus. - ceremony.go: NewCeremony bootstraps the Ed25519 root CA, enrolls all parties (setup, 4 CCs, electoral board, voting server, verifier, N voters) with CA-signed identity certs, registers each in the directory, and wires its handler into the bus. - parties.go: the six party types and a shared hello/ack handshake; Handshake() proves the full sign -> route -> verify -> reply -> verify path for every party before any election logic runs. - state.go: per-party private state structs (nothing shared across parties). - transcript.go: PublicTranscript, the append-only bulletin board a remote verifier will consume (no secrets). - phases.go: phase handlers reject unknown message types cleanly (the transport boundary never panics on unexpected input) — filled in over the next commits. Transport CA API simplified to own its serial counter (NewCA/Issue). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
30 lines
1.3 KiB
Go
30 lines
1.3 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
|
|
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
|
|
}
|