Skip to content

Commit

Permalink
FIx length in recoding.
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaranha committed Sep 11, 2024
1 parent bd5db2e commit d1ea0d5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/bn/relic_bn_rec.c
Original file line number Diff line number Diff line change
Expand Up @@ -895,16 +895,16 @@ void bn_rec_sac(int8_t *b, size_t *len, bn_t *k, size_t c, size_t m, size_t n) {
}

RLC_TRY {
/* The current basis for some curves might be one bit longer. */
fp_prime_get_par(t[0]);
l = RLC_MAX(l, bn_bits(t[0]) + 1);
for (size_t i = 0; i < m; i++) {
bn_null(t[i]);
bn_new(t[i]);
bn_copy(t[i], k[i]);
}

/* The current basis for BN curves might be one bit longer. */
for (size_t i = 0; i < m; i++) {
l = RLC_MAX(l, bn_bits(k[i]) + 1);
}
memset(b, 0, *len);

b[l - 1] = 0;
for (size_t i = 0; i < l - 1; i++) {
Expand Down

0 comments on commit d1ea0d5

Please sign in to comment.