axle OS
x86_32 UNIX-like hobby OS
sha256.h
1 #ifndef SHA256_H
2 #define SHA256_H
3 
4 #include <std/std.h>
5 #include <std/memory.h>
6 
7 #define SHA256_BLOCK_SIZE 32
8 
9 typedef unsigned char BYTE;
10 typedef unsigned int WORD;
11 
12 typedef struct {
13  BYTE data[64];
14  WORD datalen;
15  unsigned long long bitlen;
16  WORD state[8];
17 } SHA256_CTX;
18 
19 void sha256_init(SHA256_CTX *ctx);
20 void sha256_update(SHA256_CTX *ctx, const BYTE data[], size_t len);
21 void sha256_final(SHA256_CTX *ctx, BYTE hash[]);
22 
23 int sha256_test();
24 
25 #endif // SHA256_H
Definition: sha256.h:12