コード例 #1
0
 def testGetStr(self):
     P = G1()
     P.clear()
     self.assertEqual(P.getStr(), "0")
     self.assertEqual(
         G1.BLS12_381_G1_generator().getStr(),
         "1 3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507 1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569"
     )
コード例 #2
0
 def testAdd(self):
     gen = G1.BLS12_381_G1_generator()
     self.assertEqual(gen + gen, gen.double())
コード例 #3
0
 def testNeq(self):
     gen = G1.BLS12_381_G1_generator()
     self.assertTrue(gen != gen.double())
     self.assertFalse(gen != gen)
コード例 #4
0
 def testIsZero(self):
     gen = G1.BLS12_381_G1_generator()
     P = G1()
     P.clear()
     self.assertTrue(P.is_zero())
     self.assertFalse(gen.is_zero())
コード例 #5
0
 def testMul(self):
     gen = G1.BLS12_381_G1_generator()
     self.assertEqual(gen * Fr(2), gen.double())
コード例 #6
0
 def testSub(self):
     gen = G1.BLS12_381_G1_generator()
     self.assertEqual(gen.double() - gen, gen)