Files
app-ethereum/src_features/getPublicKey/logic_getPublicKey.c

18 lines
520 B
C
Raw Normal View History

#include <string.h>
2020-06-27 13:24:04 +02:00
#include "shared_context.h"
uint32_t set_result_get_publicKey() {
uint32_t tx = 0;
G_io_apdu_buffer[tx++] = 65;
2020-11-24 10:23:45 +01:00
memmove(G_io_apdu_buffer + tx, tmpCtx.publicKeyContext.publicKey.W, 65);
2020-06-27 13:24:04 +02:00
tx += 65;
G_io_apdu_buffer[tx++] = 40;
2020-11-24 10:23:45 +01:00
memmove(G_io_apdu_buffer + tx, tmpCtx.publicKeyContext.address, 40);
2020-06-27 13:24:04 +02:00
tx += 40;
if (tmpCtx.publicKeyContext.getChaincode) {
2020-12-01 16:20:13 +01:00
memmove(G_io_apdu_buffer + tx, tmpCtx.publicKeyContext.chainCode, 32);
tx += 32;
2020-06-27 13:24:04 +02:00
}
return tx;
}