fixed carry error on array add in HashDRBG

This commit is contained in:
John Safranek
2014-11-13 18:08:23 -08:00
parent 6c2a238c9b
commit 2c85756130

View File

@ -279,8 +279,12 @@ static INLINE void array_add(byte* d, word32 dLen, const byte* s, word32 sLen)
d[dIdx] = carry;
carry >>= 8;
}
if (dIdx > 0)
d[dIdx] += carry;
for (; carry != 0 && dIdx >= 0; dIdx--) {
carry += d[dIdx];
d[dIdx] = carry;
carry >>= 8;
}
}
}