Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(circuits): valid message censoring #1198

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions circuits/circom/processMessages.circom
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,6 @@ template ProcessOne(stateTreeDepth, voteOptionTreeDepth) {
validVoteOptionIndex.in[1] <== maxVoteOptions;

// @note pick the correct vote option index based on whether the index is < max vote options
// @todo can probably add one output to messageValidator and take from there
// or maybe we can remove altogther from messageValidator so we don't double check this
component cmdVoteOptionIndexMux = Mux1();
cmdVoteOptionIndexMux.s <== validVoteOptionIndex.out;
cmdVoteOptionIndexMux.c[0] <== 0;
Expand Down
2 changes: 0 additions & 2 deletions circuits/circom/processMessagesNonQv.circom
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,6 @@ template ProcessOneNonQv(stateTreeDepth, voteOptionTreeDepth) {
validVoteOptionIndex.in[1] <== maxVoteOptions;

// @note pick the correct vote option index based on whether the index is < max vote options
// @todo can probably add one output to messageValidator and take from there
// or maybe we can remove altogther from messageValidator so we don't double check this
component cmdVoteOptionIndexMux = Mux1();
cmdVoteOptionIndexMux.s <== validVoteOptionIndex.out;
cmdVoteOptionIndexMux.c[0] <== 0;
Expand Down
2 changes: 1 addition & 1 deletion circuits/ts/__tests__/ProcessMessages.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ describe("ProcessMessage circuit", function test() {

// Second batch is not a full batch
const numMessages = messageBatchSize * NUM_BATCHES - 1;
for (let i = 0; i < numMessages; i += 1) {
for (let i = 0; i < 6; i += 1) {
const command = new PCommand(
BigInt(index),
userKeypair.pubKey,
Expand Down
Loading