blst
blst copied to clipboard
feat(bindings/rust): add constructor for affine points
in the rust
bindings, add a constructor for affine points (i.e. p1_affines
and p2_affines
) whose argument is a slice of affine points.
The trouble is that the data will be duplicated, which is likely undesirable. Because customarily you'd work with a larger number of points. One would rather want to borrow it. In other words the question is if it's possible to arrange it so that it's borrowed, or rather cow-ed...
I agree that it would be better to avoid the allocation, but I would rather not alter the internal representation of the affine points to keep the change simple. the From
performs an allocation, and that is the only way to construct e.g. p1_affines
, so I assumed that the allocation would not be a blocker.
the From performs an allocation
It has to because it goes into a type with distinctly different memory layout, and it's computationally intensive in comparison to allocation, so it's justified. Affine to affine would be a pure waste. As for internal representation, it's not public, so it's not impossible to change it...
Have a look at #219.
#219 is merged.