#include#include #include #include #include #include #define SHA256_BLOCK_SIZE 32 typedef unsigned char BYTE; typedef unsigned int WORD; typedef struct { BYTE ctxdata[64]; WORD datalen; unsigned long long bitlen; WORD state[8]; } SHA256_CTX; void SHA256_Init(SHA256_CTX *ctx); void SHA256_Update(SHA256_CTX *ctx, const BYTE data[], WORD len); void SHA256_Final(SHA256_CTX *ctx, BYTE hash[]); int sha256_test(void);
#include "sha256.h" #define ROTLEFt(a,b) (((a) << (b)) | ((a) >> (32-(b)))) #define ROTRIGHt(a,b) (((a) >> (b)) | ((a) << (32-(b)))) #define CH(x,y,z) (((x) & (y)) ^ (~(x) & (z))) #define MAJ(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) #define EP0(x) (



