Zeth - Zerocash on Ethereum  0.8
Reference implementation of the Zeth protocol by Clearmatics
Public Member Functions | Public Attributes | List of all members
coordinator.mpc_command.MPCCommand Class Reference

Public Member Functions

def __init__ (self, Optional[str] mpc_tool="", bool dry_run=False)
 
bool linear_combination (self, str powersoftau_file, str lagrange_file, str linear_comb_out_file, Optional[int] pot_degree=None)
 
bool phase2_begin (self, str linear_comb_file, str challenge_0_file)
 
bool phase2_verify_contribution (self, str orig_challenge, str response, Optional[str] out_new_challenge=None, Optional[str] transcript=None)
 
bool phase2_verify_transcript (self, str orig_challenge, str final_challenge, str transcript, Optional[str] digest_file=None)
 
bool phase2_contribute (self, str challenge_file, str output_file, Optional[str] digest_file=None, bool skip_user_input=False)
 
bool create_keypair (self, str powersoftau_file, str linear_comb_file, str final_challenge, str keypair_out_file, Optional[int] pot_degree=None)
 

Public Attributes

 mpc_tool
 
 dry_run
 

Detailed Description

Wrapper around the 'mpc' utility.

Definition at line 13 of file mpc_command.py.

Constructor & Destructor Documentation

◆ __init__()

def coordinator.mpc_command.MPCCommand.__init__ (   self,
Optional[str]   mpc_tool = "",
bool   dry_run = False 
)

Definition at line 18 of file mpc_command.py.

18  def __init__(self, mpc_tool: Optional[str] = "", dry_run: bool = False):
19  self.mpc_tool = mpc_tool or _default_mpc_tool()
20  self.dry_run = dry_run
21  assert exists(self.mpc_tool)
22 

Member Function Documentation

◆ create_keypair()

bool coordinator.mpc_command.MPCCommand.create_keypair (   self,
str  powersoftau_file,
str  linear_comb_file,
str  final_challenge,
str  keypair_out_file,
Optional[int]   pot_degree = None 
)

Definition at line 72 of file mpc_command.py.

72  def create_keypair(
73  self,
74  powersoftau_file: str,
75  linear_comb_file: str,
76  final_challenge: str,
77  keypair_out_file: str,
78  pot_degree: Optional[int] = None) -> bool:
79  args = ["create-keypair"]
80  args += ["--pot-degree", str(pot_degree)] if pot_degree else []
81  args += [
82  powersoftau_file,
83  linear_comb_file,
84  final_challenge,
85  keypair_out_file]
86  return self._exec(args)
87 
Here is the call graph for this function:

◆ linear_combination()

bool coordinator.mpc_command.MPCCommand.linear_combination (   self,
str  powersoftau_file,
str  lagrange_file,
str  linear_comb_out_file,
Optional[int]   pot_degree = None 
)

Definition at line 23 of file mpc_command.py.

23  def linear_combination(
24  self,
25  powersoftau_file: str,
26  lagrange_file: str,
27  linear_comb_out_file: str,
28  pot_degree: Optional[int] = None) -> bool:
29  args = ["linear-combination"]
30  args += ["--pot-degree", str(pot_degree)] if pot_degree else []
31  args += [powersoftau_file, lagrange_file, linear_comb_out_file]
32  return self._exec(args)
33 
Here is the call graph for this function:

◆ phase2_begin()

bool coordinator.mpc_command.MPCCommand.phase2_begin (   self,
str  linear_comb_file,
str  challenge_0_file 
)

Definition at line 34 of file mpc_command.py.

34  def phase2_begin(self, linear_comb_file: str, challenge_0_file: str) -> bool:
35  return self._exec(["phase2-begin", linear_comb_file, challenge_0_file])
36 
Here is the call graph for this function:

◆ phase2_contribute()

bool coordinator.mpc_command.MPCCommand.phase2_contribute (   self,
str  challenge_file,
str  output_file,
Optional[str]   digest_file = None,
bool   skip_user_input = False 
)

Definition at line 61 of file mpc_command.py.

61  def phase2_contribute(
62  self,
63  challenge_file: str,
64  output_file: str,
65  digest_file: Optional[str] = None,
66  skip_user_input: bool = False) -> bool:
67  args = ["phase2-contribute", challenge_file, output_file]
68  args += ["--digest", digest_file] if digest_file else []
69  args += ["--skip-user-input"] if skip_user_input else []
70  return self._exec(args)
71 
Here is the call graph for this function:

◆ phase2_verify_contribution()

bool coordinator.mpc_command.MPCCommand.phase2_verify_contribution (   self,
str  orig_challenge,
str  response,
Optional[str]   out_new_challenge = None,
Optional[str]   transcript = None 
)

Definition at line 37 of file mpc_command.py.

37  def phase2_verify_contribution(
38  self,
39  orig_challenge: str,
40  response: str,
41  out_new_challenge: Optional[str] = None,
42  transcript: Optional[str] = None) -> bool:
43  args = ["phase2-verify-contribution"]
44  args += ["--new-challenge", out_new_challenge] \
45  if out_new_challenge else []
46  args += ["--transcript", transcript] if transcript else []
47  args += [orig_challenge, response]
48  return self._exec(args)
49 
Here is the call graph for this function:

◆ phase2_verify_transcript()

bool coordinator.mpc_command.MPCCommand.phase2_verify_transcript (   self,
str  orig_challenge,
str  final_challenge,
str  transcript,
Optional[str]   digest_file = None 
)

Definition at line 50 of file mpc_command.py.

50  def phase2_verify_transcript(
51  self,
52  orig_challenge: str,
53  final_challenge: str,
54  transcript: str,
55  digest_file: Optional[str] = None) -> bool:
56  args = ["phase2-verify-transcript"]
57  args += ["--digest", digest_file] if digest_file else []
58  args += [orig_challenge, transcript, final_challenge]
59  return self._exec(args)
60 
Here is the call graph for this function:

Member Data Documentation

◆ dry_run

coordinator.mpc_command.MPCCommand.dry_run

Definition at line 20 of file mpc_command.py.

◆ mpc_tool

coordinator.mpc_command.MPCCommand.mpc_tool

Definition at line 19 of file mpc_command.py.


The documentation for this class was generated from the following file:
test_commands.mock.str
str
Definition: mock.py:18