-
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.
Refactoring. V2.2.0 Circom Support (#6)
- Loading branch information
Showing
10 changed files
with
273 additions
and
122 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 |
---|---|---|
|
@@ -7,3 +7,9 @@ | |
[submodule "passport-zk-circuits"] | ||
path = passport-zk-circuits | ||
url = [email protected]:rarimo/passport-zk-circuits.git | ||
[submodule "ed25519-circom"] | ||
path = ed25519-circom | ||
url = [email protected]:Electron-Labs/ed25519-circom.git | ||
[submodule "maci"] | ||
path = maci | ||
url = [email protected]:privacy-scaling-explorations/maci.git |
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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
bus B1(){ | ||
signal x; | ||
} | ||
|
||
bus B2() { | ||
signal x; | ||
} | ||
|
||
template B1toB2(){ | ||
input B1() b1; | ||
output B2() b2; | ||
b2 <== b1; | ||
} | ||
|
||
bus Film() { | ||
signal title[50]; | ||
signal director[50]; | ||
signal year; | ||
} | ||
|
||
bus Date() { | ||
signal day; | ||
signal month; | ||
signal year; | ||
} | ||
|
||
bus Person() { | ||
signal name[50]; | ||
Film() films[10]; | ||
Date() birthday; | ||
} | ||
|
||
bus Line(dim){ | ||
PointN(dim) start; | ||
PointN(dim) end; | ||
} | ||
|
||
bus Figure(num_sides, dim){ | ||
Line(dim) side[num_sides]; | ||
} | ||
|
||
bus Triangle2D(){ | ||
Figure(3,2) {well_defined} triangle; | ||
} | ||
|
||
bus Square3D(){ | ||
Figure(4,3) {well_defined} square; | ||
} | ||
|
||
template well_defined_figure(num_sides, dimension){ | ||
input Figure(num_sides,dimension) t; | ||
output Figure(num_sides,dimension) {well_defined} correct_t; | ||
var all_equals = 0; | ||
var isequal = 0; | ||
for(var i = 0; i < num_sides; i=i+1){ | ||
for(var j = 0; j < dimension; j=j+1){ | ||
isequal = IsEqual()([t.side[i].end.x[j],t.side[(i+1)%num_sides].start.x[j]]); | ||
all_equals += isequal; | ||
} | ||
} | ||
all_equals === num_sides; | ||
correct_t <== t; | ||
} | ||
|
||
template Edwards2Montgomery () { | ||
input Point() { edwards_point } in ; | ||
output Point() { montgomery_point } out ; | ||
|
||
out.x <-- (1 + in.y ) / (1 - in.y ) ; | ||
out.y <-- out.x / in.x ; | ||
|
||
out.x * (1 - in.y ) === (1 + in.y ) ; | ||
out.y * in.x === out.x ; | ||
} |
Submodule ed25519-circom
added at
99490f
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.