diff --git a/crypto/zk/prover/pubsignals.go b/crypto/zk/prover/pubsignals.go index 14f07c7a4..fd581b308 100644 --- a/crypto/zk/prover/pubsignals.go +++ b/crypto/zk/prover/pubsignals.go @@ -42,7 +42,7 @@ func (p *Proof) ElectionID() ([]byte, error) { if err != nil { return nil, err } - return util.SplittedArboStrToBytes(electionID1str, electionID2str, false, false), nil + return util.SplittedArboStrToBytes(electionID1str, electionID2str, false, true), nil } // VoteHash returns the VoteHash included into the current proof. diff --git a/util/zk.go b/util/zk.go index 21f1164e8..c6e7187ee 100644 --- a/util/zk.go +++ b/util/zk.go @@ -54,10 +54,10 @@ func SplittedArboToBytes(input1, input2 *big.Int, swap, strict bool) []byte { } if strict { for len(b1) < 16 { - b1 = append(b1, 0) + b1 = append([]byte{0}, b1...) } for len(b2) < 16 { - b2 = append(b2, 0) + b2 = append([]byte{0}, b2...) } } return append(b1, b2...)