#ifndef BP_LIB_CRYPTO_H
#define BP_LIB_CRYPTO_H
#include <Uefi.h>
#include <Protocol/SimpleFileSystem.h>
#include "../sphincsplus/api.h"
#include "console.h"
#include "disk.h"
typedef struct {
  UINT8 *digest;
  UINTN size_bytes;
} bp_crypto_HASH_DIGEST;
typedef struct {
  UINT32 memory_cost;
  UINT32 time_cost;
  UINT8 *salt;
  UINTN salt_size;
  bp_console_PASSWORD password;
  UINTN hash_size;
} bp_crypto_ARGON2_CONTEXT;
typedef struct {
  UINT8 pk[CRYPTO_PUBLICKEYBYTES];
  UINT8 sk[CRYPTO_SECRETKEYBYTES];
  BOOLEAN erase_pk;
  BOOLEAN erase_sk;
} bp_crypto_SPHINCSPLUS_KEYPAIR;
EFI_STATUS bp_crypto_secure_erase(UINT8 *ptr,UINTN size);
EFI_STATUS bp_crypto_sha3(UINT8 *input,UINTN size_input,UINTN size_output,bp_crypto_HASH_DIGEST **output);
EFI_STATUS bp_crypto_argon2id_raw(bp_crypto_ARGON2_CONTEXT *context,bp_crypto_HASH_DIGEST **output);
EFI_STATUS bp_crypto_argon2d_raw(bp_crypto_ARGON2_CONTEXT *context,bp_crypto_HASH_DIGEST **output);
EFI_STATUS bp_crypto_argon2i_raw(bp_crypto_ARGON2_CONTEXT *context,bp_crypto_HASH_DIGEST **output);
EFI_STATUS bp_crypto_sphincsplus_keypair_seed(UINT8 *seed,UINTN seed_size,BOOLEAN erase_sk,BOOLEAN erase_pk,bp_crypto_SPHINCSPLUS_KEYPAIR **output);
EFI_STATUS bp_crypto_sphincsplus_verify(UINT8 *signature,UINTN signature_size,UINT8 *message,UINTN message_size,UINT8 *pk);
EFI_STATUS bp_crypto_sphincsplus_verify_file(EFI_FILE_PROTOCOL *root,CHAR16 *file,CHAR16 *sigfile,UINT8 *pk);
#endif
