From 458f9b7172148a272b23d61747f0758bf21dbf1f Mon Sep 17 00:00:00 2001 From: Özgür Kesim Date: Wed, 20 Mar 2024 22:31:56 +0100 Subject: veto: added more comments --- veto/veto.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'veto') diff --git a/veto/veto.go b/veto/veto.go index f4faa38..e59ec43 100644 --- a/veto/veto.go +++ b/veto/veto.go @@ -284,14 +284,16 @@ func (coms coms) prod() (product *point) { } // For a given slice of commitments of length n, compute -// -// g^y_i = Prod(g^x_j, 1, i-1)/Prod(g^x_j, i+1, n) +// g^y_i = Prod(g^x_j, 1, i-1)/Prod(g^x_j, i+1, n) func (coms coms) computeGy(index int) *point { gy1 := coms[:index].prod() gy2 := coms[index+1:].prod().inv() return gy1.mult(gy2) } +// Round2 implements the round 2 of the AV-Net protocol, where a participant +// has received all commitments from the other participants and calculates +// g^(c*y), where c is either private.r (when veto is true) or private.x. func (v *Vote) Round2(participants []*Commitment) (gcy *point, e error) { var c int for _, p := range participants { @@ -322,6 +324,9 @@ func (v *Vote) Round2(participants []*Commitment) (gcy *point, e error) { return gy.scalarMult(v.private.x), nil } +// IsVetoed is the final step in the AV-Net protocol, where each participant, has +// received the g^(c_i*y_i) from all other participants and calculates the product +// of them. If the result is the unit element of the group, no veto was present. func (pts points) IsVetoed() bool { product := pts.prod() one := one() -- cgit v1.2.3