vlmcsd/src/crypto_windows.h

35 lines
854 B
C
Raw Normal View History

2015-11-29 10:30:52 +01:00
/*
* crypto_windows.h
*/
#ifdef _CRYPTO_WINDOWS
#ifndef CRYPTO_WINDOWS_H_
#define CRYPTO_WINDOWS_H_
#if !_WIN32 && !__CYGWIN__
#error You cannot use Windows CryptoAPI on non-Windows platforms
#else // _WIN32 || __CYGWIN__
#include "types.h"
2016-10-08 07:35:48 +02:00
#if _MSC_VER
#include "Wincrypt.h"
#endif
2015-11-29 10:30:52 +01:00
typedef struct _Sha2356HmacCtx
{
HCRYPTHASH hHmac;
HCRYPTKEY hKey;
} Sha256HmacCtx;
2016-10-08 07:35:48 +02:00
int_fast8_t Sha256(BYTE* restrict data, DWORD DataSize, BYTE* restrict hash);
2015-11-29 10:30:52 +01:00
int_fast8_t Sha256Hmac(const BYTE* key, BYTE* restrict data, DWORD len, BYTE* restrict hmac);
/*int_fast8_t Sha256HmacInit(Sha256HmacCtx *Ctx, BYTE *key, uint8_t keySize);
int_fast8_t Sha256HmacUpdate(Sha256HmacCtx *Ctx, BYTE *data, DWORD len);
int_fast8_t Sha256HmacFinish(Sha256HmacCtx *Ctx, BYTE *hmac);*/
#endif // _WIN32 || __CYGWIN__
#endif /* CRYPTO_WINDOWS_H_ */
#endif // _CRYPTO_WINDOWS