EIP-712 code linting

This commit is contained in:
Alexandre Paillier
2022-07-19 11:49:18 +02:00
parent 0cf21cdf73
commit de9e895ad9
44 changed files with 778 additions and 1402 deletions

View File

@@ -5,15 +5,14 @@
static const uint8_t EIP_712_MAGIC[] = {0x19, 0x01};
unsigned int ui_712_approve_cb(const bagl_element_t *e)
{
unsigned int ui_712_approve_cb(const bagl_element_t *e) {
uint8_t privateKeyData[INT256_LENGTH];
uint8_t hash[INT256_LENGTH];
uint8_t signature[100];
cx_ecfp_private_key_t privateKey;
uint32_t tx = 0;
(void)e;
(void) e;
io_seproxyhal_io_heartbeat();
cx_keccak_init(&global_sha3, 256);
cx_hash((cx_hash_t *) &global_sha3,
@@ -57,12 +56,10 @@ unsigned int ui_712_approve_cb(const bagl_element_t *e)
&info);
explicit_bzero(&privateKey, sizeof(privateKey));
G_io_apdu_buffer[0] = 27;
if (info & CX_ECCINFO_PARITY_ODD)
{
if (info & CX_ECCINFO_PARITY_ODD) {
G_io_apdu_buffer[0]++;
}
if (info & CX_ECCINFO_xGTn)
{
if (info & CX_ECCINFO_xGTn) {
G_io_apdu_buffer[0] += 2;
}
format_signature_out(signature);
@@ -77,9 +74,8 @@ unsigned int ui_712_approve_cb(const bagl_element_t *e)
return 0; // do not redraw the widget
}
unsigned int ui_712_reject_cb(const bagl_element_t *e)
{
(void)e;
unsigned int ui_712_reject_cb(const bagl_element_t *e) {
(void) e;
reset_app_context();
G_io_apdu_buffer[0] = 0x69;
G_io_apdu_buffer[1] = 0x85;

View File

@@ -7,4 +7,4 @@
unsigned int ui_712_approve_cb(const bagl_element_t *e);
unsigned int ui_712_reject_cb(const bagl_element_t *e);
#endif // COMMON_EIP712_H_
#endif // COMMON_EIP712_H_