X-Git-Url: https://git.cryptolib.org/?p=avr-crypto-lib.git;a=blobdiff_plain;f=bigint2%2Fbigint2.c;fp=bigint2%2Fbigint2.c;h=4b5dbe0555ff86d425c63bef049f73de0378ace7;hp=449070b3c9e117636683d8e0b899ab971da5cfd4;hb=226bfa4c5fa7435f253221d76506f8d977bfb91b;hpb=cda2e9d578a68a57f3bd95c3ddbc5db78c7e3b36 diff --git a/bigint2/bigint2.c b/bigint2/bigint2.c index 449070b..4b5dbe0 100644 --- a/bigint2/bigint2.c +++ b/bigint2/bigint2.c @@ -700,9 +700,10 @@ int bigint_divide(bigint_t *q, bigint_t *r, const bigint_t *a, const bigint_t *b } i = la - lb; if (q) { - if ((ret = check_size(q, (i + BIGINT_WORD_SIZE - 1) / BIGINT_WORD_SIZE))) { + if ((ret = check_size(q, (i + BIGINT_WORD_SIZE) / BIGINT_WORD_SIZE))) { return ret; } + q->length_W = (i + BIGINT_WORD_SIZE) / BIGINT_WORD_SIZE; memset(q->wordv, 0, q->allocated_W * sizeof(bigint_word_t)); } if (r) {