Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Fix: 'type' required as domain parameter for WeierstrassCurve, TwistedEdwardCurve and MontgomeryCurve #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/ecpy/curves.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,8 @@ class WeierstrassCurve(Curve):
def __init__(self, domain):
""" Built an new short Weierstrass curve with the provided parameters. """
self._domain = {}
self._set(domain, ('name','type', 'size',
self._domain['type'] = curve_defs.WEIERSTRASS
self._set(domain, ('name', 'size',
'a','b','field','generator','order','cofactor'))


Expand Down Expand Up @@ -506,7 +507,8 @@ class TwistedEdwardCurve(Curve):
def __init__(self, domain):
""" Built an new short twisted Edward curve with the provided parameters. """
self._domain = {}
self._set(domain, ('name','type','size',
self._domain['type'] = curve_defs.TWISTEDEDWARD
self._set(domain, ('name','size',
'a','d','field','generator','order'))

def _coord_size(self):
Expand Down Expand Up @@ -766,9 +768,10 @@ class MontgomeryCurve(Curve):
"""

def __init__(self, domain):
""" Built an new short twisted Edward curve with the provided parameters. """
""" Built an new short Montgomery curve with the provided parameters. """
self._domain = {}
self._set(domain, ('name','type','size',
self._domain['type'] = curve_defs.MONTGOMERY
self._set(domain, ('name','size',
'a','b','field','generator','order'))
#inv4 = pow(4,p-2,p)
#self.a24 = ((self.a+2)*inv4)%p
Expand Down