Files
app-ethereum/src_features/signMessageEIP712/field_hash.h

32 lines
634 B
C
Raw Normal View History

2022-05-02 15:30:14 +02:00
#ifndef FIELD_HASH_H_
#define FIELD_HASH_H_
#ifdef HAVE_EIP712_FULL_SUPPORT
2022-05-02 15:30:14 +02:00
#include <stdint.h>
2022-04-14 18:22:35 +02:00
#include <stdbool.h>
2022-05-02 15:30:14 +02:00
2022-04-14 18:22:35 +02:00
#define IS_DYN(type) (((type) == TYPE_SOL_STRING) || ((type) == TYPE_SOL_BYTES_DYN))
typedef enum
{
FHS_IDLE,
FHS_WAITING_FOR_MORE
} e_field_hashing_state;
typedef struct
{
uint16_t remaining_size;
uint8_t state; // e_field_hashing_state
} s_field_hashing;
bool field_hash_init(void);
2022-05-12 17:30:26 +02:00
void field_hash_deinit(void);
2022-05-04 11:54:22 +02:00
bool field_hash(const uint8_t *data,
uint8_t data_length,
bool partial);
#endif // HAVE_EIP712_FULL_SUPPORT
2022-05-02 15:30:14 +02:00
#endif // FIELD_HASH_H_