def powop(self, a, b):
    'return a**b'
    m = gmpy.mpz(1)
    'exponentiation by a scalar'
    if ((not isinstance(b, int)) and (not isinstance(b, long)) and (not (type(b) == type(m)))):
        raise Exception('Exponentation by a non integer, long or mpz')
    c = b
    if ((c > (self.char - 1)) or (c < 0)):
        c = (b % (self.char - 1))
    if (c == 0):
        assert (not ((a.val % self.char) == 0))
        return self.one()
    elif (c == 1):
        return a
    else:
        return self.sqrtAndMultply(a, a, c)
return a**b
def powop(self, a, b):
    
    m = gmpy.mpz(1)
    'exponentiation by a scalar'
    if ((not isinstance(b, int)) and (not isinstance(b, long)) and (not (type(b) == type(m)))):
        raise Exception('Exponentation by a non integer, long or mpz')
    c = b
    if ((c > (self.char - 1)) or (c < 0)):
        c = (b % (self.char - 1))
    if (c == 0):
        assert (not ((a.val % self.char) == 0))
        return self.one()
    elif (c == 1):
        return a
    else:
        return self.sqrtAndMultply(a, a, c)