From e7dba670d67b8d151418d865746ec3acc826b372 Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Mon, 19 Sep 2022 10:04:30 +1000 Subject: [PATCH] SP int: mp_init_size fix for sp_mont_norm sp_mont_norm should check wrong parameter when determining whether the calculation values will fit. --- wolfcrypt/src/sp_int.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wolfcrypt/src/sp_int.c b/wolfcrypt/src/sp_int.c index 752f37cb3..bc0578fbb 100644 --- a/wolfcrypt/src/sp_int.c +++ b/wolfcrypt/src/sp_int.c @@ -15076,7 +15076,7 @@ int sp_mont_norm(sp_int* norm, sp_int* m) } if (err == MP_OKAY) { bits = sp_count_bits(m); - if (bits == m->size * SP_WORD_SIZE) { + if (bits >= norm->size * SP_WORD_SIZE) { err = MP_VAL; } }