#ifndef INCLUDE_hash_win32_h__
#define INCLUDE_hash_win32_h__
#include "hash/sha.h"
#include <wincrypt.h>
typedef enum {
GIT_HASH_WIN32_INVALID = 0,
GIT_HASH_WIN32_CRYPTOAPI,
GIT_HASH_WIN32_CNG
} git_hash_win32_provider_t;
struct git_hash_win32_cryptoapi_ctx {
bool valid;
HCRYPTHASH hash_handle;
};
struct git_hash_win32_cng_ctx {
bool updated;
HANDLE hash_handle;
PBYTE hash_object;
};
typedef struct {
ALG_ID algorithm;
union {
struct git_hash_win32_cryptoapi_ctx cryptoapi;
struct git_hash_win32_cng_ctx cng;
} ctx;
} git_hash_win32_ctx;
git_hash_win32_provider_t git_hash_win32_provider(void);
int git_hash_win32_set_provider(git_hash_win32_provider_t provider);
#ifdef GIT_SHA1_WIN32
struct git_hash_sha1_ctx {
git_hash_win32_ctx win32;
};
#endif
#ifdef GIT_SHA256_WIN32
struct git_hash_sha256_ctx {
git_hash_win32_ctx win32;
};
#endif
#endif