-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WitnessTester.compute supports multiple output signals (#104)
* WitnessTester.compute supports multiple output signals * Missed test circuit source
- Loading branch information
Showing
3 changed files
with
62 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
pragma circom 2.0.0; | ||
|
||
template Multiout(N) { | ||
signal input a[N]; | ||
signal input b[N]; | ||
var newSize = N + N - 1; | ||
signal output cOut[N]; | ||
signal output aOut[newSize]; | ||
signal output bOut[newSize]; | ||
|
||
var a1[newSize]; | ||
var b1[newSize]; | ||
var c1[N]; | ||
for(var i = 0; i<N; i++) { | ||
a1[i] = a[i] * i; | ||
b1[i] = b[i] * i; | ||
c1[i] = a[i] * b[i]; | ||
} | ||
|
||
cOut <== c1; | ||
aOut <== a1; | ||
bOut <== b1; | ||
} | ||
|
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