From 0336fdb98d923410e0eec141a6a3fe89e358b7c6 Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Fri, 17 Jul 2020 11:27:59 +1000 Subject: [PATCH] Fix SP math for small builds --- wolfcrypt/src/sp_int.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/src/sp_int.c b/wolfcrypt/src/sp_int.c index 0f66c10d2..e21f4888f 100644 --- a/wolfcrypt/src/sp_int.c +++ b/wolfcrypt/src/sp_int.c @@ -785,10 +785,11 @@ static int sp_div(sp_int* a, sp_int* d, sp_int* r, sp_int* rem) sp_int tr[1]; sp_int trial[1]; #endif + int o; #ifdef WOLFSSL_SP_SMALL int c; #else - int j, o; + int j; sp_int_word tw; sp_int_sword sw; #endif @@ -897,7 +898,7 @@ static int sp_div(sp_int* a, sp_int* d, sp_int* r, sp_int* rem) #ifdef WOLFSSL_SP_SMALL do { _sp_mul_d(d, t, trial, i - d->used); - c = _sp_cmp_abs(trial, sa); + c = sp_cmp(trial, sa); if (c == MP_GT) { t--; }