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

refactor: clean iop APIs + add Marshal methods #337

Merged
merged 15 commits into from
Feb 14, 2023
Merged

Conversation

gbotrel
Copy link
Collaborator

@gbotrel gbotrel commented Feb 10, 2023

iop package methods / functions are more consistent, and takes as argument / return the same type *iop.Polynomial .

There is now only Polynomial (previously WrappedPolynomial); the contract of this struct is consistent;

it is initialized with a pointer to a slice of field elements (the coefficients: *[]fr.Element) and any calls on Polynomial methods will mutate the original slice (even if it needs to grow for a FFT).

The method Clone() *Polynomial performs a deep-copy and clones the underlying vector of coefficients.

The method ShallowClone() *Polynomial returns a new object with the same underlying coefficients; this allows modification of the shift size and blindedSize attributres (Blind method for example) without re-allocating.

Additionally, Polynomial now implements io.ReaderFrom and io.WriterTo.

  • fix: vector marshal methods on pointer type
  • feat: support for Vector encode / decode in Marshal
  • refactor: merge Polynomial and WrappedPolynomial
  • refactor: make Coefficients private and expose Slice access
  • recfactor: fix constructor with []fr.Element input
  • remove more apis with unexposed struct
  • remove more apis with unexposed struct
  • remove more apis with unexposed struct
  • refactor: most consistent APIs
  • style :code cleaning
  • refactor: resize -> grow
  • feat: added WriterTo and ReaderFrom to Polynomial

@gbotrel gbotrel merged commit c9721e1 into develop Feb 14, 2023
@gbotrel gbotrel deleted the refactor/iop branch February 14, 2023 17:39
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