-
Notifications
You must be signed in to change notification settings - Fork 76
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
25 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,22 @@ | ||
|
||
pragma circom 2.1.5; | ||
|
||
include "circomlib/circuits/poseidon.circom"; | ||
|
||
|
||
/// @title EmailNullifier | ||
/// @notice An opinionated way of calculating the email nullifier | ||
/// @notice nullifier = poseidon(poseidon(signature)) | ||
/// @param bitPerChunk The number of bits per chunk the signature is split into | ||
/// @param chunkSize The number of chunks the signature is split into | ||
/// @input signature The signature of the email | ||
/// @output out The email nullifier | ||
template EmailNullifier(bitPerChunk, chunkSize) { | ||
signal input signature[chunkSize]; | ||
|
||
signal output out; | ||
|
||
signal signatureHash <== PoseidonLarge(bitPerChunk, chunkSize)(signature); | ||
|
||
out <== Poseidon(1)([signatureHash]); | ||
} |
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