Check out the Issue Explorer
Looking to fund some work? You can submit a new Funded Issue here.
By @Bhargavasomu from: https://github.com/ethereum/py_ecc/issues/24#issuecomment-442701351
The following things come to my mind.
* The classes `FQ`, `FQP`, `FQ2` and `FQ12` need not be reinitialized every time as they are not dependent on the type of curve or extension. So probably we could have these created in `field_elements.py` and we could use them everywhere (`bn128`, `optimized_bn128`, `bls`, `optimized_bls`).
* We could also have a general class `BaseCurve`, and then maybe every curve (`bn128_curve`, `optimized_bn128_curve`, ...) could inherit this and make the changes specific to the inherited class.
* We should probably move the constants into a seperate file (`constants.py`)
* We should also remove the assert statements which are not part of any function, but are part of the script in general, as shown
* Also the type hinting should be further generalized wherever possible (in terms of removing redundant types; like `Optimized_FQPoint2D` could be replaced by `FQPoint2D`). Similary the type hinting should be carried out for the `bs12_381` and `optimized_bs12_381` submodules.
Also the only difference I see in all the curves is
* Difference in the constants such as `b`, `b2`, `b12`, `G2`, `G12` ...
* Difference in the `twist` function
@vbuterin are my facts right or am I missing anything.
@pipermerriam is the above design ok?