Elliptic curves over generic rings - #2836
Conversation
|
Looks quite good at a glance. Consider changing There is |
I was thinking the same, but If we are ok with
And same thing for the division, powering, sqrt, gcd, factoriation, fractions and etc, so a lot of things would just fail. From a mathematic standpoint that's a bit weird.
I'll look into it |
|
GR is really generics, just designed with rings as the main use case. We already have GR structures that are just groups (permutation groups, Dirichlet groups, the modular group), vector spaces/modules (e.g. n x m matrices over R) or just sets that happen to support arithmetic between some of their elements (e.g. the set of matrices of any shape over R). |
|
Elliptic curves are really groups and not rings / fields etc. I don't think they should be treated as For example, it's natural to feed elements of type One could argue that the whole system could be generalised with some general group However, this level of abstraction I think offers little value to the end user. Rather a new type I do however also see that as soon as you start adding something like elliptic curves, FLINT is exposing itself to enormous scope creep and you end up with a TODO list which looks a lot like trying to match PARI. When I had more free time I was working on Arrowhead precisely because i thought elliptic curves in flint would be a fun job, so I support the creation of |
oh! I thought GR meant general rings |
|
Personally I really don't mind, I guess from a design perspective it can be nice to have most structure integrated in |
Both should be done, I still haven't fully implemented a few nice features like letting About that matter, I saw that Also, since we have different point representations, for now I kept the points as their own thing, and only the elliptic curve itself is included in the generic structures that |
|
@fredrik-johansson Also I have a few questions on integration within |
|
Operations specific to one structure don't need to be generic method. The order of a group seems common enough to be generic. Just like there is |
This draft PR aims at designing a first interface to generic ring elliptic curves. The main motivation is refactoring ECPP (e269d38) and ECM (fmpz_factor_ecm_double(nn_ptr x, nn_ptr z, nn_ptr x0, nn_ptr z0)).
The proposed interface handles multiple curves and points representation and automatically does conversion when it's worth it (for example, switching to Jacobian coordinates for point multiplication). The focus is on really preserving genericity and handling curves over generic commutative rings while having dedicated efficient routines for the main cases of interest (finite fields and Q).
Currently the performance of elliptic curve arithmetic either matches or outperforms
ecpp_point_mul_grbut the interface and documentation (AI generated) are a bit heavy and clunky.For now I'm focusing on simplifying the interface (the AI version exposes A LOT of things) and making the documentation human-readable.
Feel free to comment on this draft for any recommendations on clarity / interface / technical stuff.