Line | |
---|
1 | #ifndef SH_CHECKSUM_H
|
---|
2 | #define SH_CHECKSUM_H
|
---|
3 |
|
---|
4 | typedef unsigned char sha2_byte ;
|
---|
5 | typedef UINT32 sha2_word32;
|
---|
6 | typedef UINT64 sha2_word64;
|
---|
7 |
|
---|
8 |
|
---|
9 | #define SHA256_BLOCK_LENGTH 64
|
---|
10 | #define SHA256_SHORT_BLOCK_LENGTH (SHA256_BLOCK_LENGTH - 8)
|
---|
11 | #define SHA256_DIGEST_LENGTH 32
|
---|
12 | #define SHA256_DIGEST_STRING_LENGTH (SHA256_DIGEST_LENGTH * 2 + 1)
|
---|
13 |
|
---|
14 | typedef struct _SHA256_CTX {
|
---|
15 | sha2_word32 state[8];
|
---|
16 | sha2_word64 bitcount;
|
---|
17 | sha2_byte buffer[SHA256_BLOCK_LENGTH];
|
---|
18 | } SHA256_CTX;
|
---|
19 |
|
---|
20 | void SHA256_Init(SHA256_CTX *);
|
---|
21 | void SHA256_Update(SHA256_CTX*, const sha2_byte*, size_t);
|
---|
22 | void SHA256_Final(sha2_byte[SHA256_DIGEST_LENGTH], SHA256_CTX*);
|
---|
23 | char* SHA256_End(SHA256_CTX*, char[KEYBUF_SIZE]);
|
---|
24 | char* SHA256_Data(const sha2_byte*, size_t, char[KEYBUF_SIZE]);
|
---|
25 | char* SHA256_Base2Hex(char * b64digest, char * hexdigest);
|
---|
26 | char * SHA256_ReplaceBaseByHex(const char * str, char * before, char after);
|
---|
27 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.