Skip to content

Commit

Permalink
unittests/hashs: Fixed wrong string length
Browse files Browse the repository at this point in the history
  • Loading branch information
fzi-haxel committed Dec 8, 2023
1 parent 3d3a4ef commit 055471a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/unittests/tests-hashes/tests-hashes-sha512.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 055471a

Please sign in to comment.