WIP field hashing support

This commit is contained in:
Alexandre Paillier
2022-04-14 18:22:35 +02:00
parent 0e9cd91ecc
commit a3f5eee116
5 changed files with 160 additions and 91 deletions

View File

@@ -2,8 +2,23 @@
#define FIELD_HASH_H_
#include <stdint.h>
#include <stdbool.h>
const uint8_t *field_hash(const void *const structs_array,
const uint8_t *const data,
const uint8_t data_length);
#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;
const uint8_t *field_hash(const uint8_t *data,
uint8_t data_length,
bool partial);
#endif // FIELD_HASH_H_