From d9cb1cfbe16f7741614e860b257c8223f9176459 Mon Sep 17 00:00:00 2001 From: toddouska Date: Thu, 12 Nov 2015 10:22:31 -0800 Subject: [PATCH] fix idea_mult() for 16 and 32bit systems --- wolfcrypt/src/idea.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/src/idea.c b/wolfcrypt/src/idea.c index d7ab766d7..534aa1165 100644 --- a/wolfcrypt/src/idea.c +++ b/wolfcrypt/src/idea.c @@ -44,9 +44,10 @@ */ static INLINE word16 idea_mult(word16 x, word16 y) { - long mul, res; + word32 mul; + long res; - mul = (long)x * (long)y; + mul = (word32)x * (word32)y; if (mul) { res = (mul & IDEA_MASK) - (mul >> 16); if (res <= 0)