the canonical form
:param long e, d: coefficients of the equation of the elliptic curve in
the twisted Edwards form
+ :param str name: human-readable curve name
"""
- def __init__(self, p, q, a, b, x, y, cofactor=1, e=None, d=None):
+ def __init__(self, p, q, a, b, x, y, cofactor=1, e=None, d=None, name=None):
self.p = p
self.q = q
self.a = a
if not self.contains((x, y)):
raise ValueError("Invalid parameters")
self._st = None
+ self.name = name
@property
def point_size(self):
return point_size(self.p)
+ def __repr__(self):
+ return "<%s: %s>" % (self.__class__.__name__, self.name)
+
def pos(self, v):
"""Make positive number
"""
CURVES["id-tc26-gost-3410-2012-512-paramSetA"] = CURVES["id-tc26-gost-3410-12-512-paramSetA"]
CURVES["id-tc26-gost-3410-2012-512-paramSetB"] = CURVES["id-tc26-gost-3410-12-512-paramSetB"]
CURVES["id-tc26-gost-3410-2012-512-paramSetC"] = CURVES["id-tc26-gost-3410-12-512-paramSetC"]
+for name, curve in CURVES.items():
+ curve.name = name
DEFAULT_CURVE = CURVES["id-tc26-gost-3410-12-256-paramSetB"]