mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-01-27 06:35:22 +00:00
Tidy-up
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
parent
df2d5b1ca1
commit
b169671c50
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user