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

Conversation

greuet
Copy link

@greuet greuet commented May 20, 2022

Hi,

I tried to define a TwistedEdwardCurve by hand, e.g.

from ecpy.curves import TwistedEdwardCurve

p_25519 = 2**255 - 19
a_25519 = -1
d_25519 = 0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3
Gx_25519 = 0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a
Gy_25519 = 0x6666666666666666666666666666666666666666666666666666666666666658
q_25519 = 2**252 + 27742317777372353535851937790883648493

cv = TwistedEdwardCurve ({'name': 'myTECurve',
                          'size': 256,
                          'a': a_25519,
                          'd': d_25519,
                          'field': p_25519,
                          'generator': [Gx_25519, Gy_25519],
                          'order': q_25519})

but I got an error because the 'type' key was expected as a domain parameter.

Then I set 'type' inside the class initialization for WeierstrassCurve, TwistedEdwardCurve and MontgomeryCurve, so that as described in the documentation, it is not needed anymore as a parameter.

  'type' not needed as domain parameter anymore for WeierstrassCurve,
   TwistedEdwardCurve and MontgomeryCurve, as described in documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant