Cleanup os_mem* functions
This commit is contained in:
committed by
TamtamHero
parent
374580431d
commit
d43f7f6698
@@ -35,8 +35,8 @@ void handleGetPublicKey(uint8_t p1, uint8_t p2, uint8_t *dataBuffer, uint16_t da
|
||||
cx_ecfp_init_private_key(CX_CURVE_256K1, privateKeyData, 32, &privateKey);
|
||||
io_seproxyhal_io_heartbeat();
|
||||
cx_ecfp_generate_pair(CX_CURVE_256K1, &tmpCtx.publicKeyContext.publicKey, &privateKey, 1);
|
||||
os_memset(&privateKey, 0, sizeof(privateKey));
|
||||
os_memset(privateKeyData, 0, sizeof(privateKeyData));
|
||||
memset(&privateKey, 0, sizeof(privateKey));
|
||||
memset(privateKeyData, 0, sizeof(privateKeyData));
|
||||
io_seproxyhal_io_heartbeat();
|
||||
getEthAddressStringFromKey(&tmpCtx.publicKeyContext.publicKey, tmpCtx.publicKeyContext.address, &global_sha3, chainConfig);
|
||||
#ifndef NO_CONSENT
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
uint32_t set_result_get_publicKey() {
|
||||
uint32_t tx = 0;
|
||||
G_io_apdu_buffer[tx++] = 65;
|
||||
os_memmove(G_io_apdu_buffer + tx, tmpCtx.publicKeyContext.publicKey.W, 65);
|
||||
memmove(G_io_apdu_buffer + tx, tmpCtx.publicKeyContext.publicKey.W, 65);
|
||||
tx += 65;
|
||||
G_io_apdu_buffer[tx++] = 40;
|
||||
os_memmove(G_io_apdu_buffer + tx, tmpCtx.publicKeyContext.address, 40);
|
||||
memmove(G_io_apdu_buffer + tx, tmpCtx.publicKeyContext.address, 40);
|
||||
tx += 40;
|
||||
if (tmpCtx.publicKeyContext.getChaincode) {
|
||||
os_memmove(G_io_apdu_buffer + tx, tmpCtx.publicKeyContext.chainCode, 32);
|
||||
memmove(G_io_apdu_buffer + tx, tmpCtx.publicKeyContext.chainCode, 32);
|
||||
tx += 32;
|
||||
}
|
||||
return tx;
|
||||
|
||||
Reference in New Issue
Block a user