diff options
Diffstat (limited to 'veto')
-rw-r--r-- | veto/veto.go | 9 |
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() |