From c07df36f9e402ef8b97beb92b25556b04c10c77e Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Thu, 13 Apr 2023 14:54:12 +0100 Subject: [PATCH] More fixes for big-endian Signed-off-by: Dave Rodgman --- tests/suites/test_suite_alignment.function | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/tests/suites/test_suite_alignment.function b/tests/suites/test_suite_alignment.function index b027c4b116..717c51a695 100644 --- a/tests/suites/test_suite_alignment.function +++ b/tests/suites/test_suite_alignment.function @@ -18,19 +18,9 @@ int parse_hex_string(char *hex_string, uint64_t *result) return 0; } - /* If < 8 bytes, shift right and pad with leading zeros for big-endian */ - if (MBEDTLS_IS_BIG_ENDIAN && olen < 8) { - memmove(raw + 8 - olen, raw, olen); - memset(raw, 0, 8 - olen); - } - *result = 0; for (size_t i = 0; i < olen; i++) { - if (MBEDTLS_IS_BIG_ENDIAN) { - *result |= ((uint64_t) raw[i]) << (i * 8); - } else { - *result |= ((uint64_t) raw[i]) << ((olen - i - 1) * 8); - } + *result |= ((uint64_t) raw[i]) << ((olen - i - 1) * 8); } return 1; }