1 /*********************************************************************
3 * Author: Brad Conte (brad AT bradconte.com)
5 * Disclaimer: This code is presented "as is" without any guarantees.
6 * Details: Defines the API for the corresponding SHA1 implementation.
7 *********************************************************************/
12 /*************************** HEADER FILES ***************************/
15 /****************************** MACROS ******************************/
16 #define SHA256_BLOCK_SIZE 32 // SHA256 outputs a 32 byte digest
18 /**************************** DATA TYPES ****************************/
19 typedef unsigned char BYTE; // 8-bit byte
20 typedef unsigned int WORD; // 32-bit word, change to "long" for 16-bit machines
25 unsigned long long bitlen;
29 /*********************** FUNCTION DECLARATIONS **********************/
30 void sha256_init(SHA256_CTX *ctx);
31 void sha256_update(SHA256_CTX *ctx, const BYTE data[], size_t len);
32 void sha256_final(SHA256_CTX *ctx, BYTE hash[]);