@@ 191,13 191,13 @@ func (el *Election) SendEvals(client *mautrix.Client) error {
for _, voterJoinId := range *el.FinalVoters {
voter := el.Joins[voterJoinId]
output := el.LocalVoter.Poly.Eval(&voter.Input)
- if voter.JoinEvt.ID == el.LocalVoter.JoinEvt.ID {
- el.LocalVoter.Eval = output
- }
var nonce [24]byte
if _, err := io.ReadFull(rand.Reader, nonce[:]); err != nil {
return err
}
+ if voter.JoinEvt.ID == el.LocalVoter.JoinEvt.ID {
+ el.LocalVoter.Eval = output
+ }
encrypted := box.Seal(nonce[:], output.Bytes(), &nonce, &voter.PubKey, &el.LocalVoter.PrivKey)
content.Outputs[voter.JoinEvt.ID] = base64.StdEncoding.EncodeToString(encrypted)
}