def changeB(self): temp = self._b.get() if Polynomial.isValid(temp): self.b = Polynomial(temp) % self.modulus self._b.delete(0, END) self._b.insert(0, self.b) E = BinaryEllipticCurve(self.a, self.b, self.modulus) self._output.insert(END, str(E) + "\n") else: self._b.delete(0, END) self._b.insert(0, self.b) self._output.insert(END, "There was an error with your input. Please try again.\n")
def changeModulus(self): temp = self._irred.get() if Polynomial.isValid(temp): self.modulus = Polynomial(temp) self.r = self.modulus.degree() self.curveString.set("E : F_(2^" + str(self.r) + ") : y^2 + xy = x^3 + ") self._irred.delete(0, END) self._irred.insert(0, self.modulus) E = BinaryEllipticCurve(self.a, self.b, self.modulus) self._output.insert(END, "The irreducible polynomial is now set to " + str(self.modulus) + ".\n") else: self._irred.delete(0, END) self._irred.insert(0, self.modulus) self._output.insert(END, "There was an error with your input. Please try again.\n")
def randomPoints(self): s = BinaryEllipticCurve.listRandomPoints(BinaryEllipticCurve(self.a, self.b, self.modulus), self.m) self._output.insert(END, s + "\n")
def randomECs(self): s = BinaryEllipticCurve.listRandomECs((1<<self.modulus.degree()), self.modulus, self.n) self._output.insert(END, s + "\n")
def pointOrder(self): ord = BinaryEllipticCurve(self.a, self.b, self.modulus).pointOrder(PolynomialPoint(self.Gx, self.Gy, Polynomial("1"))) self._output.insert(END, "|G| = " + str(ord) + "\n")
def order(self): ord = BinaryEllipticCurve(self.a, self.b, self.modulus).order() self._output.insert(END, "|E| = " + str(ord) + "\n")
def log(self): E = BinaryEllipticCurve(self.a, self.b, self.modulus) P = PolynomialPoint(self.Px, self.Py, Polynomial("1")) G = PolynomialPoint(self.Gx, self.Gy, Polynomial("1")) R = E.log(P, G) self._output.insert(END, "log_G" + str(P) + " = " + str(R) + "\n")