This algorithm implementation is a part of my cryptography implementations project. The full project, along with licensing information and more detail, is hosted on GitHub.
Algorithm
This is an implementation of the SHA256 hash algorithm.
Code Documentation

SHA256_CTX
A MD5 structure that will hold all hashrelated data and calculations as the hash is calculated. 
SHA256_init(SHA256_CTX *ctx)
Initializes the SHA256_CTX object. 
SHA1_update(SHA256_CTX *ctx, unsigned char data[], int len)
Once an object has been created and initialized, the data to be hashed must be added. Due to practical limitations, it may not be optimal (or possible) to add all the data to the SHA256 hash in one data chunk, so the function inputs, stores, and calculates data as it is received, allowing the data to be added in as many chunks as necessary.
unsigned char data[]
This is the data to be added to the hash. 
int len
This is the length, in bytes, of the data in the "data" array.


SHA256_final(SHA256_CTX *ctx, unsigned char hash[])
Finalize and output the hash. 
unsigned char hash[]
This is the array to store the output hash, which is 32 bytes long.
Code Usage
 Create an SHA256_CTX object.
 Initialize it with sha256_init().
 Read some/all of the data to hash into an array, calculate the size of the data, and add it to the hash with sha256_update().
 Repeat the previous step for all the data you want to hash.
 Finalize and output the hash with sha256_final().
Repeat steps (2) to (5) for as many hashes as you want to calculate.
Code
Notes
The 32bit words (aka, unsigned integers) used in the code assume little endian byte ordering. The SHA256 specification uses the big endian byte order, so some bytereversals are made when copying data into and out of integers in this code.
Note that this only provides the 256bit variant of the SHA2 specification.
This algorithm has only basic optimizations, and does not have very fast benchmarks. This algorithm has passed testing against numerous test vectors, including all official vectors.