def power(n, m)
      result = 1
      v = n
      while m > 0
        result = mod result * v if m.odd?
        v = square v
        m >>= 1
      end
      result
    end
def power(n, m)
      result = 1
      v = n
      while m > 0
        result = mod result * v if m.odd?
        v = square v
        m >>= 1
      end
      result
    end
Computes `n` raised to the power `m`.
 This algorithm uses the same idea as {Point#multiply_by_scalar}.

 @param n (Integer) the base
 @param m (Integer) the exponent
 @return (Integer)