Skip to content

Commit 42930b2

Browse files
authored
Merge pull request #7790 from JacobBarthelmeh/random
fix for casting with add
2 parents 324e714 + b28e22a commit 42930b2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

wolfcrypt/src/random.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ static WC_INLINE void array_add(byte* d, word32 dLen, const byte* s, word32 sLen
594594

595595
dIdx = (int)dLen - 1;
596596
for (sIdx = (int)sLen - 1; sIdx >= 0; sIdx--) {
597-
carry += (word16)(d[dIdx] + s[sIdx]);
597+
carry += (word16)d[dIdx] + (word16)s[sIdx];
598598
d[dIdx] = (byte)carry;
599599
carry >>= 8;
600600
dIdx--;

0 commit comments

Comments
 (0)