Definition at line 81 of file test_bls12_377_contract.py.
◆ setUpClass()
None test_contracts.test_bls12_377_contract.TestBLS12_377Contract.setUpClass |
( |
| ) |
|
|
static |
Definition at line 84 of file test_bls12_377_contract.py.
84 def setUpClass() -> None:
85 print(
"Deploying TestBLS12_377.sol")
86 _web3, eth = mock.open_test_web3()
87 _bls12_interface, bls12_instance = mock.deploy_contract(
93 BLS12_INSTANCE = bls12_instance
◆ test_bls12_ecadd()
None test_contracts.test_bls12_377_contract.TestBLS12_377Contract.test_bls12_ecadd |
( |
|
self | ) |
|
Check that [6] == [2] + [4]
Definition at line 95 of file test_bls12_377_contract.py.
95 def test_bls12_ecadd(self) -> None:
97 Check that [6] == [2] + [4]
99 result = BLS12_INSTANCE.functions.testECAdd(G1_2 + G1_4).call()
100 self.assertEqual(G1_6, result)
◆ test_bls12_ecmul()
None test_contracts.test_bls12_377_contract.TestBLS12_377Contract.test_bls12_ecmul |
( |
|
self | ) |
|
Check that [-8] == -2 * [4]
Definition at line 102 of file test_bls12_377_contract.py.
102 def test_bls12_ecmul(self) -> None:
104 Check that [-8] == -2 * [4]
106 result = BLS12_INSTANCE.functions.testECMul(G1_4 + FR_MINUS_2).call()
107 self.assertEqual(G1_MINUS_8, result)
◆ test_bls12_ecpairing()
None test_contracts.test_bls12_377_contract.TestBLS12_377Contract.test_bls12_ecpairing |
( |
|
self | ) |
|
Check that e([6], [4]) * e([3],[8]) * e([4],[4]) * e([-8], [8]) == 1
Definition at line 109 of file test_bls12_377_contract.py.
109 def test_bls12_ecpairing(self) -> None:
111 Check that e([6], [4]) * e([3],[8]) * e([4],[4]) * e([-8], [8]) == 1
115 points = G1_6 + G2_4 + G1_3 + G2_8 + G1_4 + G2_4 + G1_MINUS_8 + G2_8
116 result = BLS12_INSTANCE.functions.testECPairing(points).call()
117 self.assertEqual(1, result)
119 points = G1_6 + G2_4 + G1_3 + G2_8 + G1_4 + G2_4 + G1_MINUS_8 + G2_4
120 result = BLS12_INSTANCE.functions.testECPairing(points).call()
121 self.assertEqual(0, result)
The documentation for this class was generated from the following file: