From 055471af68c2cf3013e49aecec45a8a1d16b58a1 Mon Sep 17 00:00:00 2001 From: Frederik Haxel Date: Fri, 8 Dec 2023 16:52:04 +0100 Subject: [PATCH] unittests/hashs: Fixed wrong string length --- tests/unittests/tests-hashes/tests-hashes-sha512.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unittests/tests-hashes/tests-hashes-sha512.c b/tests/unittests/tests-hashes/tests-hashes-sha512.c index 122fa1b564a1..87c5c59246be 100644 --- a/tests/unittests/tests-hashes/tests-hashes-sha512.c +++ b/tests/unittests/tests-hashes/tests-hashes-sha512.c @@ -348,12 +348,12 @@ static void test_hashes_sha512_hash_update_twice(void) sha512_context_t sha512; sha512_init(&sha512); - sha512_update(&sha512, (uint8_t*)teststring, sizeof(teststring)); + sha512_update(&sha512, (uint8_t*)teststring, strlen(teststring)); sha512_final(&sha512, hash_update_once); sha512_init(&sha512); sha512_update(&sha512, (uint8_t*)teststring, 3); - sha512_update(&sha512, (uint8_t*)&teststring[3], sizeof(teststring)-3); + sha512_update(&sha512, (uint8_t*)&teststring[3], strlen(teststring)-3); sha512_final(&sha512, hash_update_twice); TEST_ASSERT(memcmp(hash_update_once, hash_update_twice, SHA512_DIGEST_LENGTH) == 0);