Skip to content

Commit

Permalink
Fix for bit counting.
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaranha committed Jan 4, 2024
1 parent d3d5d5f commit fd9def9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/fb/relic_fb_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void fb_set_bit(fb_t a, uint_t bit, int value) {
size_t fb_bits(const fb_t a) {
int i = RLC_FB_DIGS - 1;

while (i >= 0 && a[i] == 0) {
while (i > 0 && a[i] == 0) {
i--;
}

Expand Down
2 changes: 1 addition & 1 deletion src/fp/relic_fp_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void fp_set_bit(fp_t a, uint_t bit, int value) {
size_t fp_bits(const fp_t a) {
int i = RLC_FP_DIGS - 1;

while (i >= 0 && a[i] == 0) {
while (i > 0 && a[i] == 0) {
i--;
}

Expand Down

0 comments on commit fd9def9

Please sign in to comment.