From cb6a138caff27a82e8e58eeb7e779dd8d5e63088 Mon Sep 17 00:00:00 2001 From: kaleb-himes Date: Tue, 10 May 2022 08:43:18 -0600 Subject: [PATCH] Implement peer review feedback --- wolfcrypt/src/sp_int.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wolfcrypt/src/sp_int.c b/wolfcrypt/src/sp_int.c index f08af1bfc..b9980fdcc 100644 --- a/wolfcrypt/src/sp_int.c +++ b/wolfcrypt/src/sp_int.c @@ -14527,9 +14527,8 @@ int sp_mont_setup(sp_int* m, sp_int_digit* rho) #endif /* SP_WORD_SIZE >= 32 */ #endif /* SP_WORD_SIZE >= 16 */ - /* rho = -1/m mod b, subtract x (unsigned) from 0 (MP_ZPOS) and - * assign negative result */ - *rho = (sp_int_digit) (MP_ZPOS - x); + /* rho = -1/m mod b, subtract x (unsigned) from 0, assign negative */ + *rho = (sp_int_digit) ((sp_int_digit)0 - (sp_int_digit)x); } return err;