Exemple #1
0
    def testNeq(self):
        g1 = G1()
        g1.setStr(test_data.G1_STR)

        random_fr = Fr()
        random_fr.setByCSPRNG()

        random_fr2 = Fr()
        random_fr2.setByCSPRNG()
        self.assertNotEqual(g1 * random_fr, g1 * random_fr2)
Exemple #2
0
    def testPairing(self):
        fr1 = Fr()
        fr1.setByCSPRNG()

        g1 = G1()
        g1.setStr(test_data.G1_STR)

        g2 = G2()
        g2.setStr(test_data.G2_STR)

        fr2 = Fr()
        fr2.setByCSPRNG()

        gt = GT.pairing(g1 * fr1, g2 * fr2)

        self.assertIsNotNone(gt)
Exemple #3
0
 def testIsEqual(self):
     l = Fr()
     l.setByCSPRNG()
     self.assertTrue(l == l)