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

Add to_bits_be for FieldElement<Stark252PrimeField> #866

Closed
wants to merge 3 commits into from

Conversation

tcoratger
Copy link
Contributor

Add to_bits_be for FieldElement<Stark252PrimeField>

Description

Following to_bits_le, an implementation of to_bits_be for FieldElement<Stark252PrimeField> is added. A unit test is also integrated to validate the correct implementation of the two methods.

Type of change

Please delete options that are not relevant.

  • New feature
  • Bug fix
  • Optimization

Checklist

  • Linked to Github Issue
  • Unit tests added
  • This change requires new documentation.
    • Documentation has been added/updated.
  • This change is an Optimization
    • Benchmarks added/run

@tcoratger tcoratger requested a review from a team as a code owner April 21, 2024 22:26
@MauroToscano
Copy link
Collaborator

Bits operations in field elements is a bad idea. In the base type it's ok, if you want to use it you should use the raw data of the base type or call the representative. Calling the representative all the time means a heavy penalty to the operation cost, so it's not a good idea to use it

@MauroToscano
Copy link
Collaborator

I see now that we have the to bits_le, we should probably remove both in the future, in the meanwhile we can add it

@MauroToscano MauroToscano reopened this Apr 22, 2024
@diegokingston
Copy link
Contributor

We will be removing the functionality of to_bits_le, so I am closing this PR

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.

3 participants