aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÖzgür Kesim <oec@codeblau.de>2024-03-20 22:31:56 +0100
committerÖzgür Kesim <oec@codeblau.de>2024-03-20 22:31:56 +0100
commit458f9b7172148a272b23d61747f0758bf21dbf1f (patch)
treeb7e0fe8c458f74669f6ea91c2200429154849a5d
parent6017ace9301d0078e34bdbb3b29ef71e4ba408a5 (diff)
veto: added more comments
-rw-r--r--veto/veto.go9
1 files changed, 7 insertions, 2 deletions
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()