1
0

crypto_windows.h 789 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * crypto_windows.h
  3. */
  4. #ifdef _CRYPTO_WINDOWS
  5. #ifndef CRYPTO_WINDOWS_H_
  6. #define CRYPTO_WINDOWS_H_
  7. #if !_WIN32 && !__CYGWIN__
  8. #error You cannot use Windows CryptoAPI on non-Windows platforms
  9. #else // _WIN32 || __CYGWIN__
  10. #include "types.h"
  11. typedef struct _Sha2356HmacCtx
  12. {
  13. HCRYPTHASH hHmac;
  14. HCRYPTKEY hKey;
  15. } Sha256HmacCtx;
  16. int_fast8_t Sha256(BYTE *data, DWORD len, BYTE *hash);
  17. int_fast8_t Sha256Hmac(const BYTE* key, BYTE* restrict data, DWORD len, BYTE* restrict hmac);
  18. /*int_fast8_t Sha256HmacInit(Sha256HmacCtx *Ctx, BYTE *key, uint8_t keySize);
  19. int_fast8_t Sha256HmacUpdate(Sha256HmacCtx *Ctx, BYTE *data, DWORD len);
  20. int_fast8_t Sha256HmacFinish(Sha256HmacCtx *Ctx, BYTE *hmac);*/
  21. #endif // _WIN32 || __CYGWIN__
  22. #endif /* CRYPTO_WINDOWS_H_ */
  23. #endif // _CRYPTO_WINDOWS