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

perf: non-native ToBitsCanonical inline binary decomposition and range checking #1225

Open
2 tasks
ivokub opened this issue Jul 25, 2024 · 0 comments
Open
2 tasks
Assignees
Labels
consolidate strengthen an existing feature

Comments

@ivokub
Copy link
Collaborator

ivokub commented Jul 25, 2024

Currently in the PR #1224 for obtaining canonical bit representation of the non-native element we first reduce the element, assert that it is in range and then call the non-native ToBits method. However, in this case we do essentially binary decomposition twice:

  1. when asserting that non-native element is in range in AssertIsInRange method
  2. when doing binary decomposition of the limbs in ToBits method

Secondly, it would be good if we have also an option to provide ToBits and ToBitsCanonical the number of bits we are interested in. This for example allows to avoid AssertIsInRange in case where we require only a few bits (as in native ToBits)

  • It would be better to merge the two operations for better efficiency.
  • Add option for requesting less bits
@ivokub ivokub added the consolidate strengthen an existing feature label Jul 25, 2024
@ivokub ivokub self-assigned this Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consolidate strengthen an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant