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

arithmetic internals: Clarify evenness check for empty limbs. #2277

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

briansmith
Copy link
Owner

It would be questionable to ask if two empty slices of limbs are even, so limbs_are_even_constant_time should return an error in that case. Luckily, we already considered empty limbs even (see the test) and callers always return an error on empty limbs. So, nothing changes, except it is clearer that we handle empty inputs correctly.

This is part of a project to clarify what happens when/if/how we pass empty slices to C.

It would be questionable to ask if two empty slices of limbs are
even, so `limbs_are_even_constant_time` should return an error in that
case. Luckily, we already considered empty limbs even (see the test)
and callers always return an error on empty limbs. So, nothing
changes, except it is clearer that we handle empty inputs correctly.

This is part of a project to clarify what happens when/if/how we
pass empty slices to C.
@briansmith briansmith self-assigned this Jan 23, 2025
Copy link

codecov bot commented Jan 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.75%. Comparing base (1371308) to head (b85021d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2277      +/-   ##
==========================================
- Coverage   96.75%   96.75%   -0.01%     
==========================================
  Files         171      171              
  Lines       20868    20866       -2     
  Branches      491      490       -1     
==========================================
- Hits        20191    20188       -3     
- Misses        571      572       +1     
  Partials      106      106              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@briansmith briansmith merged commit 76282fb into main Jan 23, 2025
168 of 169 checks passed
@briansmith briansmith deleted the b/are-no-limbs-really-even branch January 23, 2025 23:21
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.

1 participant