Skip to content

Commit

Permalink
chore(circuits): optimize converting message to command (privacy-scal…
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmad authored Jul 18, 2024
1 parent 5c38c13 commit be7a659
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
7 changes: 1 addition & 6 deletions circuits/circom/core/non-qv/processMessages.circom
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,6 @@ include "../../trees/incrementalQuinaryTree.circom";
var computedCommandsPackedCommandOut[batchSize][PACKED_CMD_LENGTH];

for (var i = 0; i < batchSize; i++) {
var message[MSG_LENGTH];
for (var j = 0; j < MSG_LENGTH; j++) {
message[j] = msgs[i][j];
}

(
computedCommandsStateIndex[i],
computedCommandsNewPubKey[i],
Expand All @@ -257,7 +252,7 @@ include "../../trees/incrementalQuinaryTree.circom";
computedCommandsSigR8[i],
computedCommandsSigS[i],
computedCommandsPackedCommandOut[i]
) = MessageToCommand()(message, coordPrivKey, encPubKeys[i]);
) = MessageToCommand()(msgs[i], coordPrivKey, encPubKeys[i]);
}

// Process messages in reverse order.
Expand Down
7 changes: 1 addition & 6 deletions circuits/circom/core/qv/processMessages.circom
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,6 @@ template ProcessMessages(
var computedCommandsPackedCommandOut[batchSize][PACKED_CMD_LENGTH];

for (var i = 0; i < batchSize; i++) {
var message[MSG_LENGTH];
for (var j = 0; j < MSG_LENGTH; j++) {
message[j] = msgs[i][j];
}

(
computedCommandsStateIndex[i],
computedCommandsNewPubKey[i],
Expand All @@ -252,7 +247,7 @@ template ProcessMessages(
computedCommandsSigR8[i],
computedCommandsSigS[i],
computedCommandsPackedCommandOut[i]
) = MessageToCommand()(message, coordPrivKey, encPubKeys[i]);
) = MessageToCommand()(msgs[i], coordPrivKey, encPubKeys[i]);
}

// Process messages in reverse order.
Expand Down

0 comments on commit be7a659

Please sign in to comment.