-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
34 additions
and
4 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
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
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 |
---|---|---|
@@ -1,11 +1,24 @@ | ||
pragma circom 2.1.6; | ||
|
||
template Math(a, b) { | ||
template Math(a, b, c) { | ||
var input1 = (a + b) / 2; | ||
var input2 = a + b / 2; | ||
|
||
var PRECOMPUTE_NUMBER = 2 ** c; | ||
|
||
signal tmp1 [a][PRECOMPUTE_NUMBER][2][b]; | ||
|
||
var STRIDE = 8; | ||
var parts = a * c \ STRIDE; | ||
|
||
signal tmp2[a] [2] [b]; | ||
signal tmp3[a] [2][2][b]; | ||
signal tmp4[a - 1][2][2][b]; | ||
|
||
signal powers[parts][2 ** STRIDE][2][a]; | ||
|
||
signal output out1[input1]; | ||
signal output out2[input2]; | ||
} | ||
|
||
component main = Math(6, 20); | ||
component main = Math(6, 20, 3); |