diff --git a/src/crypto/ripemd160.cpp b/src/crypto/ripemd160.cpp --- a/src/crypto/ripemd160.cpp +++ b/src/crypto/ripemd160.cpp @@ -294,7 +294,7 @@ ripemd160::Transform(s, buf); bufsize = 0; } - while (end >= data + 64) { + while (end - data >= 64) { // Process full chunks directly from the source. ripemd160::Transform(s, data); bytes += 64; diff --git a/src/crypto/sha1.cpp b/src/crypto/sha1.cpp --- a/src/crypto/sha1.cpp +++ b/src/crypto/sha1.cpp @@ -162,7 +162,7 @@ sha1::Transform(s, buf); bufsize = 0; } - while (end >= data + 64) { + while (end - data >= 64) { // Process full chunks directly from the source. sha1::Transform(s, data); bytes += 64; diff --git a/src/crypto/sha512.cpp b/src/crypto/sha512.cpp --- a/src/crypto/sha512.cpp +++ b/src/crypto/sha512.cpp @@ -256,7 +256,7 @@ sha512::Transform(s, buf); bufsize = 0; } - while (end >= data + 128) { + while (end - data >= 128) { // Process full chunks directly from the source. sha512::Transform(s, data); data += 128;