From c3cc36c55f64b2400101f938966bd11ac01e79cc Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Mon, 8 Feb 2021 13:20:12 +1000 Subject: [PATCH] SP int SP_WORD_SIZE=32: cast down explicitly --- wolfcrypt/src/sp_int.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/sp_int.c b/wolfcrypt/src/sp_int.c index 30d3d01a8..c20085c87 100644 --- a/wolfcrypt/src/sp_int.c +++ b/wolfcrypt/src/sp_int.c @@ -11991,7 +11991,8 @@ static int _sp_mont_red(sp_int* a, sp_int* m, sp_int_digit mp) bits = SP_WORD_SIZE; } else { - sp_int_digit mask = (1UL << (bits & (SP_WORD_SIZE - 1))) - 1; + sp_int_digit mask = (sp_int_digit) + ((1UL << (bits & (SP_WORD_SIZE - 1))) - 1); sp_int_word o = 0; w = 0; for (i = 0; i < m->used; i++) {