swisspost-evoting-go-poc/pkg/zkp/types.go
saymrwulf 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

38 lines
1 KiB
Go

package zkp
import (
emath "github.com/user/evote/pkg/math"
)
// SchnorrProof is a proof of knowledge of discrete logarithm.
// Proves knowledge of x such that y = g^x.
type SchnorrProof struct {
E emath.ZqElement // Hash challenge
Z emath.ZqElement // Response
}
// ExponentiationProof proves that multiple values are exponentiations
// of bases by the same exponent.
type ExponentiationProof struct {
E emath.ZqElement // Hash challenge
Z emath.ZqElement // Response
}
// PlaintextEqualityProof proves two ciphertexts encrypt the same plaintext
// under different keys.
type PlaintextEqualityProof struct {
E emath.ZqElement // Hash challenge
Z *emath.ZqVector // Response vector (size 2)
}
// DecryptionProof proves correct decryption of an ElGamal ciphertext.
type DecryptionProof struct {
E emath.ZqElement // Hash challenge
Z *emath.ZqVector // Response vector (size l)
}
// VerifiableDecryptions holds a set of decrypted messages with proofs.
type VerifiableDecryptions struct {
Messages []emath.GqElement
Proofs []DecryptionProof
}