Fix: int overflow
This commit is contained in:
parent
94dc4821ba
commit
504c8662eb
2 changed files with 2 additions and 2 deletions
|
@ -126,6 +126,6 @@ void md2_second_loop(uint8_t* messageDigestBuf);
|
||||||
* @param messageDigestBuf the message digest buffer
|
* @param messageDigestBuf the message digest buffer
|
||||||
* @param i the index of the 16-byte message block
|
* @param i the index of the 16-byte message block
|
||||||
*/
|
*/
|
||||||
void md2_first_loop(const uint8_t* buf, uint8_t* messageDigestBuf, int i);
|
void md2_first_loop(const uint8_t* buf, uint8_t* messageDigestBuf, size_t i);
|
||||||
|
|
||||||
#endif // MD2_COMMON_H
|
#endif // MD2_COMMON_H
|
|
@ -117,7 +117,7 @@ void md2_second_loop(uint8_t* messageDigestBuf) {
|
||||||
SECOND_LOOP_END_MARK
|
SECOND_LOOP_END_MARK
|
||||||
}
|
}
|
||||||
|
|
||||||
void md2_first_loop(const uint8_t* buf, uint8_t* messageDigestBuf, int i) {
|
void md2_first_loop(const uint8_t* buf, uint8_t* messageDigestBuf, size_t i) {
|
||||||
FIRST_LOOP_START_MARK
|
FIRST_LOOP_START_MARK
|
||||||
for (int j = 0; j < 16; j++) {
|
for (int j = 0; j < 16; j++) {
|
||||||
messageDigestBuf[16 + j] = buf[i * 16 + j];
|
messageDigestBuf[16 + j] = buf[i * 16 + j];
|
||||||
|
|
Loading…
Reference in a new issue