def random(self, _type=ZR, count=1, seed=None): if _type == GT: return self.__randomGT() elif _type in [ZR, G1, G2]: if seed != None and count == 1: return random(self.Pairing, _type, seed) elif count > 1: return tuple([random(self.Pairing, _type) for i in range(count)]) return random(self.Pairing, _type) return None
def random(self, _type=ZR, count=1, seed=None): """selects a random element in ZR, G1, G2 and GT""" if _type == GT: return self.__randomGT() elif _type in [ZR, G1, G2]: if seed is not None and count == 1: return random(self.Pairing, _type, seed) elif count > 1: return tuple([random(self.Pairing, _type) for i in range(count)]) return random(self.Pairing, _type) return None