-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: update documentation and switch to anonymous components for…
… MACI non-core circuits
- Loading branch information
Showing
31 changed files
with
857 additions
and
1,382 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
pragma circom 2.0.0; | ||
|
||
/** | ||
* Computes the cumulative sum of an array of n input signals. | ||
* It iterates through each input, aggregating the sum up to that point, | ||
* and outputs the total sum of all inputs. This template is useful for | ||
* operations requiring the total sum of multiple signals, ensuring the | ||
* final output reflects the cumulative total of the inputs provided. | ||
*/ | ||
template CalculateTotal(n) { | ||
signal input nums[n]; | ||
signal output sum; | ||
|
||
signal sums[n]; | ||
sums[0] <== nums[0]; | ||
|
||
for (var i=1; i < n; i++) { | ||
sums[i] <== sums[i - 1] + nums[i]; | ||
} | ||
|
||
sum <== sums[n - 1]; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.