-
Notifications
You must be signed in to change notification settings - Fork 2
/
SHA256.h
20 lines (15 loc) · 817 Bytes
/
SHA256.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef SHA256_H
#define SHA256_H
// The header file defines a method to compute the SHA256 hash of a block of input data.
//
// This in 'snippet' form and has no external dependencies other than on 'stdint.h' which is available on most compilers.
//
// https://en.wikipedia.org/wiki/SHA-2
//
// The actual implementation of the method is a copy of the code written by Zilong Tan ([email protected]) and released under MIT license
//
#include <stdint.h> // Include stdint.h; available on most compilers but, if not, a copy is provided here for Microsoft Visual Studio
void computeSHA256(const void *input, // A pointer to the input data to have the SHA256 hash computed for it.
uint32_t size, // the length of the input data
uint8_t destHash[32]); // The output 256 bit (32 byte) hash
#endif