From 03d5a4eaddc39f07d20517a4e3d81e25b6060e3d Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Thu, 20 Aug 2020 11:28:54 -0500 Subject: [PATCH] wolfcrypt/src/integer.c: mp_div_d(): refactor another 64 bit division to use do_div() when WOLFSSL_LINUXKM. --- wolfcrypt/src/integer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wolfcrypt/src/integer.c b/wolfcrypt/src/integer.c index 77dd58cde..a5afd8ca1 100644 --- a/wolfcrypt/src/integer.c +++ b/wolfcrypt/src/integer.c @@ -4560,7 +4560,12 @@ static int mp_div_d (mp_int * a, mp_digit b, mp_int * c, mp_digit * d) w = (w << ((mp_word)DIGIT_BIT)) | ((mp_word)a->dp[ix]); if (w >= b) { +#ifdef WOLFSSL_LINUXKM + t = (mp_digit)w; + do_div(t, b); +#else t = (mp_digit)(w / b); +#endif w -= ((mp_word)t) * ((mp_word)b); } else { t = 0;