mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-10-08 18:07:24 +00:00
change binary_string_parser for big-endian input
Signed-off-by: Kusumit Ghoderao <[email protected]>
This commit is contained in:
@@ -301,7 +301,7 @@ uint64_t parse_binary_string(data_t *bin_string)
|
|||||||
uint64_t result = 0;
|
uint64_t result = 0;
|
||||||
TEST_LE_U(bin_string->len, 8);
|
TEST_LE_U(bin_string->len, 8);
|
||||||
for (size_t i = 0; i < bin_string->len; i++) {
|
for (size_t i = 0; i < bin_string->len; i++) {
|
||||||
result = result << 64 | bin_string->x[i];
|
result = result << 8 | bin_string->x[i];
|
||||||
}
|
}
|
||||||
exit:
|
exit:
|
||||||
return result; /* returns 0 if len > 8 */
|
return result; /* returns 0 if len > 8 */
|
||||||
|
|||||||
Reference in New Issue
Block a user