Skip to content

Commit

Permalink
Simplify code a bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaranha committed Jan 4, 2024
1 parent 36f22d1 commit a7beed7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions src/fb/relic_fb_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,7 @@ size_t fb_bits(const fb_t a) {
i--;
}

if (i > 0) {
return (i << RLC_DIG_LOG) + util_bits_dig(a[i]);
} else {
return util_bits_dig(a[0]);
}
return (i << RLC_DIG_LOG) + util_bits_dig(a[i]);
}

void fb_set_dig(fb_t c, dig_t a) {
Expand Down
6 changes: 1 addition & 5 deletions src/fp/relic_fp_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,7 @@ size_t fp_bits(const fp_t a) {
i--;
}

if (i > 0) {
return (i << RLC_DIG_LOG) + util_bits_dig(a[i]);
} else {
return util_bits_dig(a[0]);
}
return (i << RLC_DIG_LOG) + util_bits_dig(a[i]);
}

void fp_set_dig(fp_t c, dig_t a) {
Expand Down

0 comments on commit a7beed7

Please sign in to comment.