mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-16 08:42:50 +00:00
Use memcmp instead of reinventing it
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
This commit is contained in:
parent
9730cb1274
commit
a2b7519d63
@ -134,13 +134,12 @@ int main(void)
|
|||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t j = 0; j < test_sha256_hash_len; j++) {
|
if (memcmp(hash, test_sha256_hash, test_sha256_hash_len) != 0)
|
||||||
if (hash[j] != test_sha256_hash[j]) {
|
{
|
||||||
mbedtls_printf("One-shot hash operation gave the wrong result!\n\n");
|
mbedtls_printf("One-shot hash operation gave the wrong result!\n\n");
|
||||||
psa_hash_abort(&hash_operation);
|
psa_hash_abort(&hash_operation);
|
||||||
psa_hash_abort(&cloned_hash_operation);
|
psa_hash_abort(&cloned_hash_operation);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mbedtls_printf("One-shot hash operation successful!\n\n");
|
mbedtls_printf("One-shot hash operation successful!\n\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user