2022-05-02 15:28:18 +02:00
|
|
|
#ifndef EIP712_H_
|
|
|
|
|
#define EIP712_H_
|
|
|
|
|
|
2022-05-16 10:59:20 +02:00
|
|
|
#ifdef HAVE_EIP712_FULL_SUPPORT
|
|
|
|
|
|
2022-05-02 15:28:35 +02:00
|
|
|
#include <stdbool.h>
|
2022-05-02 15:28:18 +02:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
// APDUs P1
|
2022-08-10 11:47:05 +02:00
|
|
|
#define P1_COMPLETE 0x00
|
|
|
|
|
#define P1_PARTIAL 0xFF
|
2022-05-02 15:28:18 +02:00
|
|
|
|
|
|
|
|
// APDUs P2
|
2022-08-19 18:31:00 +02:00
|
|
|
#define P2_DEF_NAME 0x00
|
|
|
|
|
#define P2_DEF_FIELD 0xFF
|
|
|
|
|
#define P2_IMPL_NAME P2_DEF_NAME
|
|
|
|
|
#define P2_IMPL_ARRAY 0x0F
|
|
|
|
|
#define P2_IMPL_FIELD P2_DEF_FIELD
|
|
|
|
|
#define P2_FILT_ACTIVATE 0x00
|
|
|
|
|
#define P2_FILT_MESSAGE_INFO 0x0F
|
|
|
|
|
#define P2_FILT_SHOW_FIELD 0xFF
|
2022-05-02 15:28:18 +02:00
|
|
|
|
2022-07-19 11:49:18 +02:00
|
|
|
#define DOMAIN_STRUCT_NAME "EIP712Domain"
|
2022-05-06 18:14:04 +02:00
|
|
|
|
2022-07-19 11:49:18 +02:00
|
|
|
bool handle_eip712_struct_def(const uint8_t *const apdu_buf);
|
|
|
|
|
bool handle_eip712_struct_impl(const uint8_t *const apdu_buf);
|
|
|
|
|
bool handle_eip712_sign(const uint8_t *const apdu_buf);
|
|
|
|
|
bool handle_eip712_filtering(const uint8_t *const apdu_buf);
|
|
|
|
|
void handle_eip712_return_code(bool success);
|
2022-07-05 17:18:22 +02:00
|
|
|
|
2022-07-19 11:49:18 +02:00
|
|
|
#endif // HAVE_EIP712_FULL_SUPPORT
|
2022-05-16 10:59:20 +02:00
|
|
|
|
2022-07-19 11:49:18 +02:00
|
|
|
#endif // EIP712_H_
|