mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-03-13 06:36:06 +00:00
fixup! feat(core): add libtropic to the unix build
This commit is contained in:
parent
6d5ed97f03
commit
a36c3e40fe
@ -33,17 +33,7 @@ void tropic_init(void) {
|
|||||||
uint8_t tropic_secret_tropic_pubkey[SECRET_TROPIC_KEY_LEN] = {0};
|
uint8_t tropic_secret_tropic_pubkey[SECRET_TROPIC_KEY_LEN] = {0};
|
||||||
uint8_t tropic_secret_trezor_privkey[SECRET_TROPIC_KEY_LEN] = {0};
|
uint8_t tropic_secret_trezor_privkey[SECRET_TROPIC_KEY_LEN] = {0};
|
||||||
|
|
||||||
lt_ret_t ret = LT_FAIL;
|
ensure((lt_init(<_handle) == LT_OK) * sectrue, "lt_init failed");
|
||||||
|
|
||||||
ret = lt_init(<_handle);
|
|
||||||
|
|
||||||
#if !defined(TREZOR_EMULATOR)
|
|
||||||
ensure((ret == LT_OK) * sectrue, "lt_init failed");
|
|
||||||
#else
|
|
||||||
if (ret != LT_OK) {
|
|
||||||
printf("Warning: lt_init failed: %d\n", ret);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ensure(secret_tropic_get_tropic_pubkey(tropic_secret_tropic_pubkey),
|
ensure(secret_tropic_get_tropic_pubkey(tropic_secret_tropic_pubkey),
|
||||||
"secret_tropic_get_tropic_pubkey failed");
|
"secret_tropic_get_tropic_pubkey failed");
|
||||||
@ -53,16 +43,11 @@ void tropic_init(void) {
|
|||||||
uint8_t trezor_pubkey[SECRET_TROPIC_KEY_LEN] = {};
|
uint8_t trezor_pubkey[SECRET_TROPIC_KEY_LEN] = {};
|
||||||
curve25519_scalarmult_basepoint(trezor_pubkey, tropic_secret_trezor_privkey);
|
curve25519_scalarmult_basepoint(trezor_pubkey, tropic_secret_trezor_privkey);
|
||||||
|
|
||||||
|
lt_ret_t ret = LT_FAIL;
|
||||||
ret =
|
ret =
|
||||||
lt_session_start(<_handle, tropic_secret_tropic_pubkey, PKEY_INDEX_BYTE,
|
lt_session_start(<_handle, tropic_secret_tropic_pubkey, PKEY_INDEX_BYTE,
|
||||||
tropic_secret_trezor_privkey, trezor_pubkey);
|
tropic_secret_trezor_privkey, trezor_pubkey);
|
||||||
memzero(tropic_secret_trezor_privkey, sizeof(tropic_secret_trezor_privkey));
|
memzero(tropic_secret_trezor_privkey, sizeof(tropic_secret_trezor_privkey));
|
||||||
|
|
||||||
#if !defined(TREZOR_EMULATOR)
|
|
||||||
ensure((ret == LT_OK) * sectrue, "lt_session_start failed");
|
ensure((ret == LT_OK) * sectrue, "lt_session_start failed");
|
||||||
#else
|
|
||||||
if (ret != LT_OK) {
|
|
||||||
printf("Warning: lt_session_start failed: %d\n", ret);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user