-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from barryWhiteHat/master
merge with master
- Loading branch information
Showing
26 changed files
with
10,923 additions
and
333 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
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,18 +1,21 @@ | ||
include "./hasher.circom"; | ||
include "../node_modules/circomlib/circuits/mimc.circom"; | ||
include "../node_modules/circomlib/circuits/escalarmulany.circom"; | ||
|
||
|
||
template Decrypt(N) { | ||
// Where N is the length of the | ||
// decrypted message output of the | ||
signal input message[N+1]; | ||
signal input private_key; | ||
signal output out[N]; | ||
|
||
component hasher[N]; | ||
|
||
// iv is message[0] | ||
for(var i=0; i<N; i++) { | ||
hasher[i] = Hasher(1); | ||
hasher[i].in[0] <== private_key; | ||
hasher[i].key <== message[0] + i; | ||
out[i] <== message[i+1] - hasher[i].hash | ||
hasher[i] = MiMC7(91); | ||
hasher[i].x_in <== private_key; | ||
hasher[i].k <== message[0] + i; | ||
out[i] <== message[i+1] - hasher[i].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
Oops, something went wrong.