I am trying to implement some operations on a "curve" with coordinates in a "field", where the field will have different implementations (of varying efficiency). The points on the curve can be added, I express that using core::ops::Add
, parametrized by the field implementation.
My issue is a type issue, which arises when I try to define "multiples of points" as core::ops::Mul
: multiply a point by a scalar (the multiplier), while using the addition.
Rust Playground is a stripped down version (with rubbish implementation).
What am I doing wrong here? I'm quite confused by the fact that the compiler looks for Add
on Curve<Curve<_>>
and so on. I'd assume the trait bound in line 53 is what's needed, but since it makes no difference, I commented it out.