Definition at line 153 of file zksnark.py.
◆ extended_proof_from_proto()
ExtendedProof zeth.core.zksnark.Groth16.extended_proof_from_proto |
( |
snark_messages_pb2.ExtendedProof |
ext_proof_proto | ) |
|
|
static |
Reimplemented from zeth.core.zksnark.IZKSnarkProvider.
Definition at line 262 of file zksnark.py.
262 def extended_proof_from_proto(
263 ext_proof_proto: snark_messages_pb2.ExtendedProof) -> ExtendedProof:
264 ext_proof = ext_proof_proto.groth16_extended_proof
265 return ExtendedProof(
270 inputs=json.loads(ext_proof.inputs))
◆ extended_proof_to_proto()
snark_messages_pb2.ExtendedProof zeth.core.zksnark.Groth16.extended_proof_to_proto |
( |
ExtendedProof |
ext_proof | ) |
|
|
static |
Reimplemented from zeth.core.zksnark.IZKSnarkProvider.
Definition at line 273 of file zksnark.py.
273 def extended_proof_to_proto(
274 ext_proof: ExtendedProof) -> snark_messages_pb2.ExtendedProof:
275 proof = ext_proof.proof
276 assert isinstance(proof, Groth16.Proof)
277 extproof_proto = snark_messages_pb2.ExtendedProof()
278 proof_proto = extproof_proto.groth16_extended_proof \
283 proof_proto.inputs = json.dumps(ext_proof.inputs)
284 return extproof_proto
◆ get_contract_name()
Get the verifier and mixer contracts for this SNARK.
Reimplemented from zeth.core.zksnark.IZKSnarkProvider.
Definition at line 209 of file zksnark.py.
209 def get_contract_name(pp: PairingParameters) -> str:
210 return _contract_name(
"Groth16", pp)
◆ proof_from_json_dict()
Groth16.Proof zeth.core.zksnark.Groth16.proof_from_json_dict |
( |
Dict[str, Any] |
json_dict | ) |
|
|
static |
◆ proof_to_contract_parameters()
Generate the leading parameters to the mix function for this SNARK, from a
GenericProof object.
Reimplemented from zeth.core.zksnark.IZKSnarkProvider.
Definition at line 287 of file zksnark.py.
287 def proof_to_contract_parameters(
288 proof: IProof, pp: PairingParameters) -> List[int]:
289 assert isinstance(proof, Groth16.Proof)
◆ verification_key_from_json_dict()
Reimplemented from zeth.core.zksnark.IZKSnarkProvider.
Definition at line 253 of file zksnark.py.
253 def verification_key_from_json_dict(
254 json_dict: Dict[str, Any]) -> Groth16.VerificationKey:
255 return Groth16.VerificationKey.from_json_dict(json_dict)
◆ verification_key_from_proto()
Groth16.VerificationKey zeth.core.zksnark.Groth16.verification_key_from_proto |
( |
snark_messages_pb2.VerificationKey
|
vk_obj | ) |
|
|
static |
Definition at line 229 of file zksnark.py.
229 def verification_key_from_proto(
230 vk_obj: snark_messages_pb2.VerificationKey
231 ) -> Groth16.VerificationKey:
232 vk = vk_obj.groth16_verification_key
233 return Groth16.VerificationKey(
237 abc=[G1Point.from_json_list(abc)
238 for abc
in json.loads(vk.abc_g1)])
◆ verification_key_to_contract_parameters()
Reimplemented from zeth.core.zksnark.IZKSnarkProvider.
Definition at line 213 of file zksnark.py.
213 def verification_key_to_contract_parameters(
214 vk: IVerificationKey,
215 pp: PairingParameters) -> List[int]:
216 assert isinstance(vk, Groth16.VerificationKey)
◆ verification_key_to_proto()
snark_messages_pb2.VerificationKey zeth.core.zksnark.Groth16.verification_key_to_proto |
( |
IVerificationKey |
vk | ) |
|
|
static |
Reimplemented from zeth.core.zksnark.IZKSnarkProvider.
Definition at line 241 of file zksnark.py.
241 def verification_key_to_proto(
242 vk: IVerificationKey) -> snark_messages_pb2.VerificationKey:
243 assert isinstance(vk, Groth16.VerificationKey)
244 vk_obj = snark_messages_pb2.VerificationKey()
245 groth16_key = vk_obj.groth16_verification_key
249 groth16_key.abc_g1 = json.dumps([abc.to_json_list()
for abc
in vk.abc])
The documentation for this class was generated from the following file:
- /home/runner/work/zeth/zeth/client/zeth/core/zksnark.py