From 341bd7bbbc3654d19eee9d7d8da7c47ae6201040 Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Wed, 10 Nov 2021 09:33:14 +1000 Subject: [PATCH] mp_test: when SP_INT_DIGITS is even calc was wrong --- wolfcrypt/test/test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 94b50c8a3..b59157b77 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -36533,7 +36533,7 @@ static int mp_test_mul_sqr(mp_int* a, mp_int* b, mp_int* r1, mp_int* r2, ret = mp_set(a, 1); if (ret != MP_OKAY) return -13149; - i = (SP_INT_DIGITS + 1) / 2; + i = (SP_INT_DIGITS / 2) + 1; ret = mp_mul_2d(a, i * SP_WORD_SIZE - 1, a); if (ret != MP_OKAY) return -13150;