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

New bytes_from_field_elements util #234

Merged
merged 15 commits into from
Apr 14, 2023
Merged

New bytes_from_field_elements util #234

merged 15 commits into from
Apr 14, 2023

Conversation

ggutoski
Copy link
Contributor

@ggutoski ggutoski commented Apr 13, 2023

Description

closes: #227

  • add bytes_from_field_elements() to invert bytes_to_field_elements()
  • modify bytes_to_field_elements() to encode bytes length in the first field element for use in inversion
  • remove unneeded bytes copy in bytes_to_field_elements and other tidying
  • generalize both functions from PrimeField to Field
  • TODO: used String as error type for bytes_from_field_elements---should we do something else instead?
  • minimal tests only

Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (main)
  • Linked to GitHub issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Wrote unit tests
  • Updated relevant documentation in the code
  • Added a relevant changelog entry to the Pending section in CHANGELOG.md
  • Re-reviewed Files changed in the GitHub PR explorer

mrain
mrain previously approved these changes Apr 13, 2023
Copy link
Contributor

@mrain mrain left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@chancharles92 chancharles92 left a comment

Choose a reason for hiding this comment

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

LGTM, a few minor comments. There is also a minor clippy warning.

utilities/src/conversion.rs Outdated Show resolved Hide resolved
utilities/src/conversion.rs Show resolved Hide resolved
utilities/src/conversion.rs Show resolved Hide resolved
@ggutoski
Copy link
Contributor Author

LGTM, a few minor comments. There is also a minor clippy warning.

Found the clippy warning and fixed it. It was in plonk, so not my fault. 😉

@ggutoski ggutoski merged commit c730140 into main Apr 14, 2023
@ggutoski ggutoski deleted the bytes-to-field branch April 14, 2023 12:39
utilities/src/conversion.rs Show resolved Hide resolved
utilities/src/conversion.rs Show resolved Hide resolved
alxiong pushed a commit that referenced this pull request May 12, 2023
* implement #250 (comment)

* even more rusty than #250 (comment)

* refactor compile-time checks as per #234 (comment)

* tests for extension fields

* pretty rustdoc as requested in #255 (review)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need field_elements_to_bytes util
4 participants