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

Use a Polynomial type instead of Vec<E::Fr> #103

Open
osuketh opened this issue Apr 19, 2019 · 3 comments
Open

Use a Polynomial type instead of Vec<E::Fr> #103

osuketh opened this issue Apr 19, 2019 · 3 comments

Comments

@osuketh
Copy link
Member

osuketh commented Apr 19, 2019

Operations over polynomial and commitment would be changed because of the new type definition.

pub struct Polynomial<E: Engine>(Vec<E::Fr>);

@osuketh
Copy link
Member Author

osuketh commented Apr 22, 2019

It could be type alias.

@burdges
Copy link

burdges commented Apr 22, 2019

You might want +, *, etc. defined, which prevents using a type alias. You might check into using both Vec and SmallVec with roughly:

pub struct Polynomial<E,V>(V)
where E: Engine: V: Borrow<[E::Fr]>+BorrowMut<[E::Fr]>+Default; 

Appears VecLike was deprecated in favor of just Extend though, so maybe mutation does not work so well.

@osuketh
Copy link
Member Author

osuketh commented Apr 22, 2019

LGTM! It should be implemented as operator overloadings. I've never used SmallVec. How much would it be optimized actually?

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