#include "crypt.h"
#include "bench.h"
#include "hashcash.h"

char payment[sha1::blocksize];
char inithash[sha1::hashsize];
char target[sha1::hashsize];

int
main (int argc, char **argv)
{
  u_long j;

  for (unsigned int i = 0; i < 20; i++) {
    TIME(j = hashcash_pay (payment, inithash, target, i););
    warnx << "bitcost " << i << " " << j << " iterations\n";
    if (!hashcash_check (payment, inithash, target, i)) {
      warnx << "payment doesn't match target\n";
      abort();
    }
  }
}
