#ifndef SIGSUM_QUORUM_H_INCLUDED
#define SIGSUM_QUORUM_H_INCLUDED

#include <stddef.h>
#include <stdint.h>

/* Quorum evaluation is one part of applying a Sigsum trust policy:
   "the rule that determines whether or not a subset of witnesses that
   have cosigned a tree head is strong enough to consider the tree
   head to be valid" (see
   https://git.glasklar.is/sigsum/core/sigsum-go/-/blob/main/doc/policy.md).
   A simple example of a quorum rule is to require at least k valid
   cosignatures out of n trusted witnesses, but Sigsum trust policies
   can be more complex than that, organized as a tree of witness
   groups.

   This library represents the quorum rule using a very simple stack
   machine, see doc/quorum-bytecode.md.
*/

struct sigsum_quorum
{
  /* The quorum is represented using bytecode for the stack machine
     defined in doc/quorum-bytecode.md. */
  size_t bytecode_size;
  const uint8_t *bytecode;
  /* The stack size required for evaluating the quorum. */
  size_t stack_alloc;
};

#endif /* SIGSUM_QUORUM_H_INCLUDED */
