Skip to content

Commit

Permalink
fixup! feat(core): add libtropic to unix build
Browse files Browse the repository at this point in the history
  • Loading branch information
ibz committed Sep 16, 2024
1 parent 43beb9f commit e91f6cb
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions core/embed/extmod/modtrezorcrypto/modtrezorcrypto-tropic.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,6 @@
MP_DEFINE_EXCEPTION(TropicError, Exception)


void bytes_to_chars(uint8_t const *key, char *buffer, uint16_t len)
{
uint16_t offset = 0;
memset(buffer, 0, len);

for (size_t i = 0; i < len; i++)
{
offset += sprintf(buffer + offset, "%02X", key[i]);
}
sprintf(buffer + offset, "%c", '\0');
}

#define PING_MSG "Hello!"
#define PING_MSG_LEN 6
/// mock:global
Expand Down Expand Up @@ -104,9 +92,9 @@ STATIC mp_obj_t mod_trezorcrypto_tropic_get_certificate() {
}

vstr_t vstr = {0};
vstr_init_len(&vstr, 1024);
vstr_init_len(&vstr, 512);

bytes_to_chars(X509_cert, vstr.buf, 512);
memcpy(vstr.buf, X509_cert, 512);

return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr);
}
Expand Down

0 comments on commit e91f6cb

Please sign in to comment.