Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bindings/rust): add constructor for affine points #208

Conversation

jacobkaufmann
Copy link

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.

@dot-asm
Copy link
Collaborator

dot-asm commented May 14, 2024

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...

@jacobkaufmann
Copy link
Author

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.

@dot-asm
Copy link
Collaborator

dot-asm commented May 15, 2024

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...

@dot-asm
Copy link
Collaborator

dot-asm commented May 27, 2024

Have a look at #219.

@dot-asm
Copy link
Collaborator

dot-asm commented May 30, 2024

#219 is merged.

@dot-asm dot-asm closed this May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants