Zecale - Reconciling Privacy and Scalability on Smart-Contract Chains  0.5
Reference implementation of the Zecale protocol by Clearmatics
Functions | Variables
test_commands.test_bw6_761_groth16_contract Namespace Reference

Functions

None test_bw6_761_groth16_valid (IZKSnarkProvider zksnark, Any instance, IVerificationKey aggregator_vk)
 
None test_bw6_761_groth16_invalid (IZKSnarkProvider zksnark, Any instance, IVerificationKey aggregator_vk)
 
int main ()
 

Variables

 ZECALE_DIR = get_zecale_dir()
 
 CONTRACTS_DIR = join(ZECALE_DIR, "contracts")
 
 DUMMY_APP_DIR = join(ZECALE_DIR, "testdata", "dummy_app")
 
 BW6_761_PAIRING_PARAMETERS
 

Function Documentation

◆ main()

int test_commands.test_bw6_761_groth16_contract.main ( )

Definition at line 82 of file test_bw6_761_groth16_contract.py.

82 def main() -> int:
83  web3: Any = open_web3_from_network(get_eth_network(None))
84  bw6_761_groth16_instance_desc = InstanceDescription.deploy(
85  web3,
86  join(CONTRACTS_DIR, "Groth16BW6_761_test.sol"),
87  "Groth16BW6_761_test",
88  web3.eth.accounts[0], # pylint: disable=no-member
89  None,
90  500000,
91  {"allow_paths": CONTRACTS_DIR})
92 
93  bw6_761_groth16_instance = bw6_761_groth16_instance_desc.instantiate(web3)
94  zksnark = Groth16()
95  aggregator_vk = load_verification_key(
96  zksnark, join(DUMMY_APP_DIR, "aggregator_vk.json"))
97 
98  test_bw6_761_groth16_valid(zksnark, bw6_761_groth16_instance, aggregator_vk)
99  test_bw6_761_groth16_invalid(zksnark, bw6_761_groth16_instance, aggregator_vk)
100 
101  print("========================================")
102  print("== PASSED ==")
103  print("========================================")
104  return 0
105 
106 
Here is the call graph for this function:

◆ test_bw6_761_groth16_invalid()

None test_commands.test_bw6_761_groth16_contract.test_bw6_761_groth16_invalid ( IZKSnarkProvider  zksnark,
Any  instance,
IVerificationKey  aggregator_vk 
)

Definition at line 74 of file test_bw6_761_groth16_contract.py.

75  zksnark: IZKSnarkProvider,
76  instance: Any,
77  aggregator_vk: IVerificationKey) -> None:
78  assert not _test_bw6_761_groth16_contract_with_proof(
79  zksnark, instance, aggregator_vk, "batch1-invalid.json")
80 
81 
Here is the caller graph for this function:

◆ test_bw6_761_groth16_valid()

None test_commands.test_bw6_761_groth16_contract.test_bw6_761_groth16_valid ( IZKSnarkProvider  zksnark,
Any  instance,
IVerificationKey  aggregator_vk 
)

Definition at line 66 of file test_bw6_761_groth16_contract.py.

67  zksnark: IZKSnarkProvider,
68  instance: Any,
69  aggregator_vk: IVerificationKey) -> None:
70  assert _test_bw6_761_groth16_contract_with_proof(
71  zksnark, instance, aggregator_vk, "batch1.json")
72 
73 
Here is the caller graph for this function:

Variable Documentation

◆ BW6_761_PAIRING_PARAMETERS

test_commands.test_bw6_761_groth16_contract.BW6_761_PAIRING_PARAMETERS
Initial value:
1 = PairingParameters.from_json_dict({
2  "name": "bw6-761",
3  "r": "0x01ae3a4617c510eac63b05c06ca1493b1a22d9f300f5138f1ef3622fba094800170b5d44300000008508c00000000001", # noqa
4  "q": "0x0122e824fb83ce0ad187c94004faff3eb926186a81d14688528275ef8087be41707ba638e584e91903cebaff25b423048689c8ed12f9fd9071dcd3dc73ebff2e98a116c25667a8f8160cf8aeeaf0a437e6913e6870000082f49d00000000008b", # noqa
5  "generator_g1": [
6  "0x01075b020ea190c8b277ce98a477beaee6a0cfb7551b27f0ee05c54b85f56fc779017ffac15520ac11dbfcd294c2e746a17a54ce47729b905bd71fa0c9ea097103758f9a280ca27f6750dd0356133e82055928aca6af603f4088f3af66e5b43d", # noqa
7  "0x0058b84e0a6fc574e6fd637b45cc2a420f952589884c9ec61a7348d2a2e573a3265909f1af7e0dbac5b8fa1771b5b806cc685d31717a4c55be3fb90b6fc2cdd49f9df141b3053253b2b08119cad0fb93ad1cb2be0b20d2a1bafc8f2db4e95363" # noqa
8  ],
9  "generator_g2": [
10  "0x0110133241d9b816c852a82e69d660f9d61053aac5a7115f4c06201013890f6d26b41c5dab3da268734ec3f1f09feb58c5bbcae9ac70e7c7963317a300e1b6bace6948cb3cd208d700e96efbc2ad54b06410cf4fe1bf995ba830c194cd025f1c", # noqa
11  "0x0017c3357761369f8179eb10e4b6d2dc26b7cf9acec2181c81a78e2753ffe3160a1d86c80b95a59c94c97eb733293fef64f293dbd2c712b88906c170ffa823003ea96fcd504affc758aa2d3a3c5a02a591ec0594f9eac689eb70a16728c73b61" # noqa
12  ],
13 })

Definition at line 24 of file test_bw6_761_groth16_contract.py.

◆ CONTRACTS_DIR

test_commands.test_bw6_761_groth16_contract.CONTRACTS_DIR = join(ZECALE_DIR, "contracts")

Definition at line 18 of file test_bw6_761_groth16_contract.py.

◆ DUMMY_APP_DIR

test_commands.test_bw6_761_groth16_contract.DUMMY_APP_DIR = join(ZECALE_DIR, "testdata", "dummy_app")

Definition at line 19 of file test_bw6_761_groth16_contract.py.

◆ ZECALE_DIR

test_commands.test_bw6_761_groth16_contract.ZECALE_DIR = get_zecale_dir()

Definition at line 17 of file test_bw6_761_groth16_contract.py.

main
int main(int argc, char **argv)
Definition: aggregator_server.cpp:392
test_commands.test_bw6_761_groth16_contract.test_bw6_761_groth16_valid
None test_bw6_761_groth16_valid(IZKSnarkProvider zksnark, Any instance, IVerificationKey aggregator_vk)
Definition: test_bw6_761_groth16_contract.py:66
zecale.cli.utils.load_verification_key
IVerificationKey load_verification_key(IZKSnarkProvider zksnark, str vk_file)
Definition: utils.py:11
test_commands.test_bw6_761_groth16_contract.test_bw6_761_groth16_invalid
None test_bw6_761_groth16_invalid(IZKSnarkProvider zksnark, Any instance, IVerificationKey aggregator_vk)
Definition: test_bw6_761_groth16_contract.py:74