2022-10-21 18:00:59 +02:00
|
|
|
#include "shared_context.h"
|
|
|
|
|
#include "ui_callbacks.h"
|
|
|
|
|
#include "common_712.h"
|
2024-04-12 16:40:05 +02:00
|
|
|
#include "uint_common.h"
|
2022-10-21 18:00:59 +02:00
|
|
|
|
|
|
|
|
void prepare_domain_hash_v0() {
|
2024-05-07 16:01:12 +02:00
|
|
|
array_bytes_string(strings.tmp.tmp,
|
|
|
|
|
sizeof(strings.tmp.tmp),
|
|
|
|
|
tmpCtx.messageSigningContext712.domainHash,
|
|
|
|
|
KECCAK256_HASH_BYTESIZE);
|
2022-10-21 18:00:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void prepare_message_hash_v0() {
|
2024-05-07 16:01:12 +02:00
|
|
|
array_bytes_string(strings.tmp.tmp,
|
|
|
|
|
sizeof(strings.tmp.tmp),
|
|
|
|
|
tmpCtx.messageSigningContext712.messageHash,
|
|
|
|
|
KECCAK256_HASH_BYTESIZE);
|
2022-10-21 18:00:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// clang-format off
|
|
|
|
|
UX_STEP_NOCB(
|
|
|
|
|
ux_sign_712_v0_flow_1_step,
|
|
|
|
|
pnn,
|
|
|
|
|
{
|
|
|
|
|
&C_icon_certificate,
|
2024-04-17 10:33:44 +02:00
|
|
|
"Review",
|
2022-10-21 18:00:59 +02:00
|
|
|
"typed message",
|
|
|
|
|
});
|
|
|
|
|
UX_STEP_NOCB_INIT(
|
|
|
|
|
ux_sign_712_v0_flow_2_step,
|
|
|
|
|
bnnn_paging,
|
|
|
|
|
prepare_domain_hash_v0(),
|
|
|
|
|
{
|
|
|
|
|
.title = "Domain hash",
|
|
|
|
|
.text = strings.tmp.tmp,
|
|
|
|
|
});
|
|
|
|
|
UX_STEP_NOCB_INIT(
|
|
|
|
|
ux_sign_712_v0_flow_3_step,
|
|
|
|
|
bnnn_paging,
|
|
|
|
|
prepare_message_hash_v0(),
|
|
|
|
|
{
|
|
|
|
|
.title = "Message hash",
|
|
|
|
|
.text = strings.tmp.tmp,
|
|
|
|
|
});
|
|
|
|
|
UX_STEP_CB(
|
|
|
|
|
ux_sign_712_v0_flow_4_step,
|
|
|
|
|
pbb,
|
2024-04-12 16:40:05 +02:00
|
|
|
ui_712_approve_cb(),
|
2022-10-21 18:00:59 +02:00
|
|
|
{
|
|
|
|
|
&C_icon_validate_14,
|
|
|
|
|
"Sign",
|
|
|
|
|
"message",
|
|
|
|
|
});
|
|
|
|
|
UX_STEP_CB(
|
|
|
|
|
ux_sign_712_v0_flow_5_step,
|
|
|
|
|
pbb,
|
2024-04-12 16:40:05 +02:00
|
|
|
ui_712_reject_cb(),
|
2022-10-21 18:00:59 +02:00
|
|
|
{
|
|
|
|
|
&C_icon_crossmark,
|
|
|
|
|
"Cancel",
|
|
|
|
|
"signature",
|
|
|
|
|
});
|
|
|
|
|
// clang-format on
|
|
|
|
|
|
|
|
|
|
UX_FLOW(ux_sign_712_v0_flow,
|
|
|
|
|
&ux_sign_712_v0_flow_1_step,
|
|
|
|
|
&ux_sign_712_v0_flow_2_step,
|
|
|
|
|
&ux_sign_712_v0_flow_3_step,
|
|
|
|
|
&ux_sign_712_v0_flow_4_step,
|
|
|
|
|
&ux_sign_712_v0_flow_5_step);
|