Пример #1
0
 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")
Пример #2
0
 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")
Пример #3
0
 def randomPoints(self):
     s = BinaryEllipticCurve.listRandomPoints(BinaryEllipticCurve(self.a, self.b, self.modulus), self.m)
     self._output.insert(END, s + "\n")
Пример #4
0
 def randomECs(self):
     s = BinaryEllipticCurve.listRandomECs((1<<self.modulus.degree()), self.modulus, self.n)
     self._output.insert(END, s + "\n")
Пример #5
0
 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")
Пример #6
0
 def order(self):
     ord = BinaryEllipticCurve(self.a, self.b, self.modulus).order()
     self._output.insert(END, "|E| = " + str(ord) + "\n")
Пример #7
0
 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")