lightrec: fix race that could cause a freeze during load/reset
[pcsx_rearmed.git] / deps / crypto / sha256.h
CommitLineData
ce188d4d 1/*********************************************************************
2* Filename: sha256.h
3* Author: Brad Conte (brad AT bradconte.com)
4* Copyright:
5* Disclaimer: This code is presented "as is" without any guarantees.
6* Details: Defines the API for the corresponding SHA1 implementation.
7*********************************************************************/
8
9#ifndef SHA256_H
10#define SHA256_H
11
12/*************************** HEADER FILES ***************************/
13#include <stddef.h>
14
15/****************************** MACROS ******************************/
16#define SHA256_BLOCK_SIZE 32 // SHA256 outputs a 32 byte digest
17
18/**************************** DATA TYPES ****************************/
19typedef unsigned char BYTE; // 8-bit byte
20typedef unsigned int WORD; // 32-bit word, change to "long" for 16-bit machines
21
22typedef struct {
23 BYTE data[64];
24 WORD datalen;
25 unsigned long long bitlen;
26 WORD state[8];
27} SHA256_CTX;
28
29/*********************** FUNCTION DECLARATIONS **********************/
30void sha256_init(SHA256_CTX *ctx);
31void sha256_update(SHA256_CTX *ctx, const BYTE data[], size_t len);
32void sha256_final(SHA256_CTX *ctx, BYTE hash[]);
33
34#endif // SHA256_H