A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
PixoSHA256.h
Go to the documentation of this file.
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 ****************************/
19#
20typedef uint8 PIXOVR_BYTE; // 8-bit byte
21typedef uint32 PIXOVR_WORD; // 32-bit word, change to "long" for 16-bit machines
22
23typedef struct {
24 PIXOVR_BYTE data[64];
26 unsigned long long bitlen;
27 PIXOVR_WORD state[8];
29
30/*********************** FUNCTION DECLARATIONS **********************/
31void sha256_init(SHA256_CTX *ctx);
32void sha256_update(SHA256_CTX *ctx, const PIXOVR_BYTE data[], size_t len);
33void sha256_final(SHA256_CTX *ctx, PIXOVR_BYTE hash[]);
34
35#endif // SHA256_H
void sha256_final(SHA256_CTX *ctx, PIXOVR_BYTE hash[])
uint8 PIXOVR_BYTE
Definition PixoSHA256.h:20
void sha256_update(SHA256_CTX *ctx, const PIXOVR_BYTE data[], size_t len)
uint32 PIXOVR_WORD
Definition PixoSHA256.h:21
void sha256_init(SHA256_CTX *ctx)
PIXOVR_WORD datalen
Definition PixoSHA256.h:25
unsigned long long bitlen
Definition PixoSHA256.h:26