Polymorphic MSM interface #411
Labels
D-easy
Difficulty: easy
T-design
Type: discuss API design and/or research
T-refactor
Type: cleanup/refactor
I'd suggest MSM code become polymorphic over the curve, by replacing the interface under
ark_ec::msm
with trait methods onAffineCurve
andProjectiveCurve
. There are small per-curve optimization choices one could make inside MSMs, but the primary usage would be acceleration via GPUs, WASM host calls, etc.I believe the variable base interface should look like
I think
msm_checked_len
andmsm_chunks
should become free functions, but maybe the chunk size should be controlled by the curve too, likely by makingmsm_chunks
a trait method..I'm unsure about the current form of the fixed base MSM, but assuming it's ideal then the fixed base interface could look like:
Afaik, there is no reason to preserve the ZSTs
VariableBase
andFixedBase
, but their current methods could become free functions the default implementation of the trait method calls, which maybe simplifies implementing them elsewhere, not sure.I've no idea about streaming MSMs or when they come in handy.
Thoughts?
The text was updated successfully, but these errors were encountered: