~edwargix/tallyard

17cec39089da7a2edf43c52343cedbc56fa1c6ec — David Florness 2 years ago 6c109fa
Use cached list of hash seeds
1 files changed, 1 insertions(+), 3 deletions(-)

M election/msg.go
M election/msg.go => election/msg.go +1 -3
@@ 820,13 820,11 @@ func (elections *ElectionsMap) onSumMessage(evt *event.Event) (success bool) {
		var publicCircuit math.SumCircuit
		n := len(*el.FinalJoinIDs)

		hashSeeds := make([]string, n)
		hashSelects := make([]frontend.Variable, n)
		outputHashes := make([]frontend.Variable, n)
		voterJoinIDIndex := *voter.JoinIDIndex
		for i, joinID := range *el.FinalJoinIDs {
			evaler := el.Joins[joinID]
			hashSeeds[i] = evaler.HashSeed
			if uint(i) == voterJoinIDIndex {
				hashSelects[i].Assign(1)
			} else {


@@ 834,7 832,7 @@ func (elections *ElectionsMap) onSumMessage(evt *event.Event) (success bool) {
			}
			outputHashes[i].Assign((*evaler.OutputHashes)[voterJoinIDIndex])
		}
		publicCircuit.HashSeeds = hashSeeds
		publicCircuit.HashSeeds = el.GetHashSeeds()
		publicCircuit.HashSelects = hashSelects
		publicCircuit.OutputHashes = outputHashes
		publicCircuit.Sum.Assign(sum)