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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user