#include "common.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>

#ifdef __cplusplus
extern "C" {
#endif

static const size_t BUF_SIZE = 64;

static const uint8_t target[] = {
	0xc3, 0x9f, 0x4a, 0x5f, 0x9, 0xa5, 0xb4, 0x78, 0xdb, 0xa9, 0xf4, 0xf2, 0xe5, 0xea, 0x56, 0xb0, 0x8, 0xe0, 0x1a, 0x9a, 0xed, 0xc7, 0xcb, 0x5b, 0xf7, 0x71, 0x18, 0x8a, 0xe5, 0xb9, 0xf, 0x22, 0x22, 0xed, 0x4b, 0x65, 0xe8, 0x28, 0xe, 0xfc, 0x3f, 0xa5, 0x82, 0x87, 0x68, 0xdb, 0x9b, 0xe1, 0xea, 0x93, 0xc1, 0x1a, 0x13, 0x43, 0x8d, 0x11, 0x61, 0xda, 0x7e, 0x33, 0x33, 0x56, 0xea, 0x61
};

int
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
    if (size < BUF_SIZE)
        return TEPHRA_EXIT_FAILURE;

    if (memcmp(data, target, BUF_SIZE) == 0)
        BOOM();

    return TEPHRA_EXIT_SUCCESS;
}

#ifdef __cplusplus
}
#endif
