#ifndef SIGSUM_CRYPTO_INTERNAL_H_INCLUDED
#define SIGSUM_CRYPTO_INTERNAL_H_INCLUDED

#include <stdbool.h>

/* Crypto backend, based on Nettle. */

#include <stddef.h>

#include <nettle/sha2.h>

#include "crypto.h"

struct sigsum_hash_ctx
{
  struct sha256_ctx sha256;
};

void
_sigsum_hash_init (struct sigsum_hash_ctx *ctx);

void
_sigsum_hash_update (struct sigsum_hash_ctx *ctx, size_t size, const uint8_t *data);

void
_sigsum_hash_digest (struct sigsum_hash_ctx *ctx, struct sigsum_hash *digest);

bool
_sigsum_signature_verify (const struct sigsum_pubkey *pub,
			  size_t msg_size, const uint8_t *msg,
			  const struct sigsum_signature *signature);

#endif /* SIGSUM_CRYPTO_INTERNAL_H_INCLUDED */
