#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

typedef struct ArrayU64 {
  uint64_t *ptr;
  uintptr_t len;
  uintptr_t cap;
} ArrayU64;

typedef struct Proof {
  uint32_t nonce;
  struct ArrayU64 indicies;
} Proof;

typedef struct Config {
  uint64_t labels_per_unit;
  uint32_t k1;
  uint32_t k2;
  uint32_t b;
  uint32_t n;
} Config;

/**
 * # Safety
 * proof must not be a null pointer.
 */
void free_proof(struct Proof *proof);

/**
 * Generate a proof
 */
struct Proof *generate_proof(const char *datadir,
                             const unsigned char *challenge,
                             uintptr_t challenge_len,
                             struct Config cfg);
