mirror of
https://github.com/saymrwulf/swisspost-evoting-go-poc.git
synced 2026-09-04 20:23:55 +00:00
Take the live-math cockpit down to the level of the Swiss Post crypto-primitives
class structure. The shuffle proof is no longer one line — you can now watch it
being constructed:
- Pedersen matrix commitment (CommitmentService analog): c_A = Comm(A; r),
c_{A,j} = h^{r_j} Π g_i^{A_ij}, emitted from CommitMatrix.
- All five Bayer-Groth sub-arguments, mirroring the *ArgumentService classes:
ShuffleArgument (composition + x,y,z challenges), ProductArgument,
HadamardArgument (entrywise product), ZeroArgument (bilinear star-map),
SingleValueProductArgument, MultiExponentiationArgument — each emits its
defining relation as LaTeX with live dimensions.
- Partial decryption + decryption proof (DecryptionProofService analog):
φ'_i = φ_i·γ_i^{-sk} with the ZK proof that log_g(pk) = log_γ(γ^sk).
New trace.KindArgument. Low-level Commit stays uninstrumented (called in
verification too — would flood the stream); CommitMatrix is the semantic step.
Test: a 6-voter ceremony (N=6 → 2×3 shuffle matrix, so m>1 and the full argument
tree runs) captures 345 live events across 8 kinds, and asserts all five named
sub-arguments appear.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
26 lines
660 B
Go
26 lines
660 B
Go
package mixnet
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/user/evote/pkg/trace"
|
|
)
|
|
|
|
// emitArgument publishes a KindArgument trace event for one Bayer-Groth
|
|
// sub-argument, mirroring the *ArgumentService classes of the Swiss Post
|
|
// crypto-primitives library. Cheap when tracing is off.
|
|
func emitArgument(name, caption, latex, ascii string, values map[string]string) {
|
|
trace.EmitFunc(func() trace.Event {
|
|
return trace.Event{
|
|
Kind: trace.KindArgument,
|
|
Caption: caption,
|
|
LaTeX: latex,
|
|
ASCII: ascii,
|
|
Values: values,
|
|
}
|
|
})
|
|
}
|
|
|
|
func dims(m, n int) map[string]string {
|
|
return map[string]string{"m": fmt.Sprintf("%d", m), "n": fmt.Sprintf("%d", n)}
|
|
}
|