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: introduce field.Vector #311

Merged
merged 3 commits into from
Jan 26, 2023
Merged

feat: introduce field.Vector #311

merged 3 commits into from
Jan 26, 2023

Conversation

gbotrel
Copy link
Collaborator

@gbotrel gbotrel commented Jan 24, 2023

each field package now exposes a Vector ([]Element) object, which implements the following interfaces:

//   - Stringer
//   - io.WriterTo
//   - io.ReaderFrom
//   - encoding.BinaryMarshaler
//   - encoding.BinaryUnmarshaler
//   - sort.Interface

It replaces the plookup.Table object in gnark-crypto, should probably use in ecc/Encoder functions, and will be the underlying representation of a zkSNARK witness in gnark.

  • refactor: element imports field/pool and field/hash to avoid cycles
  • feat: adds Vector in field package
  • refactor: plookup.Table -> fr.Vector

@@ -2313,7 +2325,7 @@ func (z *Element) matchVeryBigInt(aHi uint64, aInt *big.Int) error {

slice := append(z[:], aHi)

return field.BigIntMatchUint64Slice(&aIntMod, slice)
return bigIntMatchUint64Slice(&aIntMod, slice)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can start getting rid of some of the tests for subcomponents of the Pornin inverse algo not that it's been a while and it seems to work.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, even more so that... the pornin Inverse has this "fallback" mechanism to call the inverseExp.

@gbotrel gbotrel merged commit 1835092 into develop Jan 26, 2023
@gbotrel gbotrel deleted the feat/element/vector branch January 26, 2023 21:14
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