mirror of
https://github.com/tornadocash/tornado-nova
synced 2024-02-02 14:53:56 +01:00
25 lines
632 B
Plaintext
25 lines
632 B
Plaintext
include "../node_modules/circomlib/circuits/poseidon.circom";
|
|
|
|
// Since we don't use signatures, the keypair can be based on a simple hash
|
|
template Keypair() {
|
|
signal input privateKey;
|
|
signal output publicKey;
|
|
|
|
component hasher = Poseidon(1);
|
|
hasher.inputs[0] <== privateKey;
|
|
publicKey <== hasher.out;
|
|
}
|
|
|
|
template Signature() {
|
|
signal input privateKey;
|
|
signal input commitment;
|
|
signal input merklePath;
|
|
signal output out;
|
|
|
|
component hasher = Poseidon(3);
|
|
hasher.inputs[0] <== privateKey;
|
|
hasher.inputs[1] <== commitment;
|
|
hasher.inputs[2] <== merklePath;
|
|
out <== hasher.out;
|
|
}
|