Zeth - Zerocash on Ethereum
0.8
Reference implementation of the Zeth protocol by Clearmatics
mpc_tools
mpc_phase2
mpc_client.cpp
Go to the documentation of this file.
1
// Copyright (c) 2015-2022 Clearmatics Technologies Ltd
2
//
3
// SPDX-License-Identifier: LGPL-3.0+
4
5
// Utility for executing operations that are only required by "clients" (that
6
// is, participants in the MPC that only contribute and potentially validate
7
// the final transcript.
8
9
#include "
libzeth/circuits/circuit_types.hpp
"
10
#include "
libzeth/circuits/circuit_wrapper.hpp
"
11
#include "
mpc_common.hpp
"
12
#include "zeth_config.h"
13
14
using
Field
=
libzeth::defaults::Field
;
15
16
void
zeth_protoboard
(libsnark::protoboard<Field> &pb)
17
{
18
libzeth::joinsplit_gadget<
19
Field
,
20
libzeth::HashT<Field>
,
21
libzeth::HashTreeT<Field>
,
22
libzeth::ZETH_NUM_JS_INPUTS,
23
libzeth::ZETH_NUM_JS_OUTPUTS,
24
libzeth::ZETH_MERKLE_TREE_DEPTH>
25
js(pb);
26
js.generate_r1cs_constraints();
27
}
28
29
int
main
(
int
argc,
char
**argv)
30
{
31
const
std::map<std::string, mpc_subcommand *>
commands
{
32
{
"phase2-contribute"
,
mpc_phase2_contribute_cmd
},
33
{
"phase2-verify-transcript"
,
mpc_phase2_verify_transcript_cmd
},
34
{
"create-keypair"
,
mpc_create_keypair_cmd
},
35
};
36
return
mpc_main
(
commands
,
zeth_protoboard
, argc, argv);
37
}
mpc_common.hpp
commands
Definition:
__init__.py:1
main
int main(int argc, char **argv)
Definition:
mpc_client.cpp:29
mpc_phase2_contribute_cmd
mpc_subcommand * mpc_phase2_contribute_cmd
Definition:
mpc_phase2_contribute.cpp:167
libzeth::HashTreeT
mimc_compression_function_gadget< FieldT > HashTreeT
Definition:
circuit_types.hpp:28
Field
libzeth::defaults::Field Field
Definition:
mpc_subcommand.hpp:11
zeth_protoboard
void zeth_protoboard(libsnark::protoboard< Field > &pb)
Definition:
mpc_client.cpp:16
Field
libzeth::defaults::Field Field
Definition:
mpc_client.cpp:14
libzeth::BLAKE2s_256
Definition:
blake2s.hpp:24
mpc_main
int mpc_main(const std::map< std::string, mpc_subcommand * > &subcommands, const ProtoboardInitFn &pb_init, int argc, char **argv)
Main entry point into the mpc command for a given circuit.
Definition:
mpc_common.cpp:43
mpc_phase2_verify_transcript_cmd
mpc_subcommand * mpc_phase2_verify_transcript_cmd
Definition:
mpc_phase2_verify_transcript.cpp:214
circuit_types.hpp
circuit_wrapper.hpp
mpc_create_keypair_cmd
mpc_subcommand * mpc_create_keypair_cmd
Definition:
mpc_create_keypair.cpp:187
Generated on Mon Nov 28 2022 10:29:03 for Zeth - Zerocash on Ethereum by
1.8.17