def order(self): # O(q^2) algorithm, where q = 2^r polys = [] for i in range(self.getModulus().degree()): Polynomial.generatePolys(polys) count = 1 # point at infinity for i in range(len(polys)): for j in range(len(polys)): leftside = (polys[j] * polys[j] + polys[i] * polys[j]) % self.getModulus() # y^2 + xy rightside = (polys[i] * polys[i] * polys[i] + self.getA() * polys[i] * polys[i] + self.getB())\ % self.getModulus() # x^3 + ax^2 + b if leftside == rightside: count += 1 return count