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