diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index 9338d1a552..061ea6b9b2 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -594,7 +594,7 @@ static WC_INLINE void array_add(byte* d, word32 dLen, const byte* s, word32 sLen dIdx = (int)dLen - 1; for (sIdx = (int)sLen - 1; sIdx >= 0; sIdx--) { - carry += (word16)(d[dIdx] + s[sIdx]); + carry += (word16)d[dIdx] + (word16)s[sIdx]; d[dIdx] = (byte)carry; carry >>= 8; dIdx--;