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

Can I transform something from "G1Projective " to "<G as PrimeCurveAffine>::Curve"? #39

Closed
huapengcheng opened this issue Oct 21, 2022 · 3 comments

Comments

@huapengcheng
Copy link

I want to make that something whose struct is "::Curve" can be transmitted between differernt processes.But now I just be able to transmitted some "double" things.It may be able to transmit some "u64" things.So I want to get all "u64" in "::Curve".And then I can use them to form a "G1Projective" and transform it to get a "::Curve".Why I choose "G1Projective" is that I printf some "::Curve" and get following results:
image

@huapengcheng
Copy link
Author

huapengcheng commented Oct 21, 2022

Or I want to know how to get "u64"s in a " ::Curve" and how to assign "u64"s to a "::Curve" which is created by myself.

@str4d
Copy link
Member

str4d commented Dec 6, 2022

The internal representation of a Group or Curve implementation is not something that gets exposed by the group traits. If you need to move an arbitrary generic type that implements Curve between processes, you should encode it to bytes with the GroupEncoding implementation, pass that encoding between processes, and then parse it back into the type. If you need to pass a point over in a different encoding, you will need to be aware of the concrete type of that point, which means you would be using APIs provided by the concrete implementation, not the group crate.

@str4d str4d closed this as completed Dec 6, 2022
@str4d
Copy link
Member

str4d commented Dec 6, 2022

Side-note: if you know that you are dealing with specifically elliptic curve points, then the APIs we are thinking about for #30 may be an alternative. But there you would still only get generic field elements that you'd then encode to bytes, so you're generally better off just encoding the points directly with GroupEncoding.

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

No branches or pull requests

2 participants