34 for (
size_t i = 0; i < out_len; i++) {
35 if (offset + 4 > in_len) {
45 bool bip32_path_format(
const uint32_t *bip32_path,
size_t bip32_path_len,
char *out,
size_t out_len)
53 for (
uint16_t i = 0; i < bip32_path_len; i++) {
56 snprintf(out + offset, out_len - offset,
"%u", bip32_path[i] & 0x7FFFFFFFu);
57 written = strlen(out + offset);
58 if (written == 0 || written >= out_len - offset) {
59 memset(out, 0, out_len);
64 if ((bip32_path[i] & 0x80000000u) != 0) {
65 snprintf(out + offset, out_len - offset,
"'");
66 written = strlen(out + offset);
67 if (written == 0 || written >= out_len - offset) {
68 memset(out, 0, out_len);
74 if (i != bip32_path_len - 1) {
75 snprintf(out + offset, out_len - offset,
"/");
76 written = strlen(out + offset);
77 if (written == 0 || written >= out_len - offset) {
78 memset(out, 0, out_len);
bool bip32_path_format(const uint32_t *bip32_path, size_t bip32_path_len, char *out, size_t out_len)
bool bip32_path_read(const uint8_t *in, size_t in_len, uint32_t *out, size_t out_len)
uint32_t read_u32_be(const uint8_t *ptr, size_t offset)