-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-implement encrypt.circom and poseidon decrypt
Signed-off-by: Jim Zhang <[email protected]>
- Loading branch information
1 parent
be9e994
commit 257f2ab
Showing
10 changed files
with
348 additions
and
35 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,20 @@ | ||
pragma circom 2.1.4; | ||
|
||
include "../node_modules/circomlib/circuits/poseidon.circom"; | ||
|
||
template TestPoseidonEx() { | ||
signal input inputs[4]; | ||
signal output out[4]; | ||
|
||
component poseidon = PoseidonEx(4, 4); | ||
poseidon.initialState <== 0; | ||
poseidon.inputs[0] <== inputs[0]; | ||
poseidon.inputs[1] <== inputs[1]; | ||
poseidon.inputs[2] <== inputs[2]; | ||
poseidon.inputs[3] <== inputs[3]; | ||
|
||
out[0] <== poseidon.out[0]; | ||
out[1] <== poseidon.out[1]; | ||
out[2] <== poseidon.out[2]; | ||
out[3] <== poseidon.out[3]; | ||
} |
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,17 @@ | ||
pragma circom 2.1.4; | ||
|
||
include "../node_modules/circomlib/circuits/poseidon.circom"; | ||
|
||
template TestPoseidon() { | ||
signal input a; | ||
signal input b; | ||
signal input c; | ||
signal output out; | ||
|
||
component poseidon = Poseidon(3); | ||
poseidon.inputs[0] <== a; | ||
poseidon.inputs[1] <== b; | ||
poseidon.inputs[2] <== c; | ||
|
||
out <== poseidon.out; | ||
} |
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,5 @@ | ||
pragma circom 2.1.4; | ||
|
||
include "../../../circuits/lib/poseidon-ex.circom"; | ||
|
||
component main = TestPoseidonEx(); |
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,5 @@ | ||
pragma circom 2.1.4; | ||
|
||
include "../../../circuits/lib/poseidon.circom"; | ||
|
||
component main = TestPoseidon(); |
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.