Skip to content

Commit

Permalink
recover padding on elections ID, and fix padding position
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmenendez committed Jun 6, 2024
1 parent 2b792d3 commit cf10ed5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crypto/zk/prover/pubsignals.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions util/zk.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
Expand Down

0 comments on commit cf10ed5

Please sign in to comment.