latchset / python-rubenesque

Pure Python implementation of standard elliptic curves
BSD 2-Clause "Simplified" License
17 stars 14 forks source link

MDC201601 (Million Dollar Curve) needs explicit import #8

Closed sundarnagarajan closed 6 years ago

sundarnagarajan commented 6 years ago

rubenesque.curves.find('MDC201601') fails with the following exception: Unknown curve 'MDC201601'

If you import rubenesque.curves.mdc.MDC201601 explicitly before calling find() there is no exception:

Sample code:

import rubenesque.curves

print('MDC201601 cannot be found without explicit import')
  curve_name = 'MDC201601'
  try:
      curve = rubenesque.curves.find(curve_name)
  except Exception as e:
      print('Exception: ' + e.args[0])
      from rubenesque.curves.mdc import MDC201601       # noqa: F401

  curve = rubenesque.curves.find(curve_name)