Fix comparison test in hash_equal, release 1.0.1.

The result in the loop was being reset each iteration; only the last
element in the byte array was being checked for equality.
This commit is contained in:
Kyle
2015-12-22 21:41:05 -08:00
parent 54b986f6f6
commit 0cf03528c5
6 changed files with 33 additions and 4 deletions

View File

@@ -55,7 +55,7 @@ hash_equal(const uint8_t *a, const uint8_t *b)
EMSHA_CHECK(b != NULL, false);
for (uint32_t i = 0; i < SHA256_HASH_SIZE; i++) {
res = a[i] ^ b[i];
res += a[i] ^ b[i];
}
return res == 0;