mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-10-20 07:37:56 +00:00
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user