Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
Dave Rodgman 2023-04-13 13:46:46 +01:00
parent df2d5b1ca1
commit b169671c50

View File

@ -20,13 +20,8 @@ int parse_hex_string(char *hex_string, uint64_t *result)
/* If < 8 bytes, shift right and pad with leading zeros for big-endian */
if (MBEDTLS_IS_BIG_ENDIAN && olen < 8) {
int offset = 8 - olen;
for (int i = olen - 1; i >= 0; i--) {
raw[i + offset] = raw[i];
}
for (int i = 0; i < offset; i++) {
raw[i] = 0;
}
memmove(raw + 8 - olen, raw, olen);
memset(raw, 0, 8 - olen);
}
*result = 0;