1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-03 12:00:59 +00:00

embed/extmod/modtrezorcrypto: remove redundant code in bip32

This commit is contained in:
Pavol Rusnak 2018-02-09 12:33:55 +01:00
parent 593ccdafec
commit 9aa947d2e1
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -88,9 +88,9 @@ STATIC mp_obj_t mod_trezorcrypto_HDNode_make_new(const mp_obj_type_t *type, size
mp_obj_HDNode_t *o = m_new_obj(mp_obj_HDNode_t); mp_obj_HDNode_t *o = m_new_obj(mp_obj_HDNode_t);
o->base.type = type; o->base.type = type;
o->fingerprint = (uint32_t)fingerprint; o->fingerprint = fingerprint;
o->hdnode.depth = (uint32_t)depth; o->hdnode.depth = depth;
o->hdnode.child_num = (uint32_t)child_num; o->hdnode.child_num = child_num;
if (NULL != chain_code.buf && 32 == chain_code.len) { if (NULL != chain_code.buf && 32 == chain_code.len) {
memcpy(o->hdnode.chain_code, chain_code.buf, 32); memcpy(o->hdnode.chain_code, chain_code.buf, 32);
} else { } else {
@ -149,9 +149,6 @@ STATIC mp_obj_t mod_trezorcrypto_HDNode_derive_path(mp_obj_t self, mp_obj_t path
uint32_t pi; uint32_t pi;
uint32_t pints[plen]; uint32_t pints[plen];
for (pi = 0; pi < plen; pi++) { for (pi = 0; pi < plen; pi++) {
if (!MP_OBJ_IS_INT(pitems[pi])) {
mp_raise_TypeError("Index has to be int");
}
pints[pi] = mp_obj_get_int_truncated(pitems[pi]); pints[pi] = mp_obj_get_int_truncated(pitems[pi]);
} }