HMAC-SHA256 on large data files
A SHA-256 implementation usable on several blocks can be turned it into an HMAC-SHA-256 implementation usable on several blocks, as follows:


If the key is larger than 64 bytes, replace it by its 32-byte SHA-256 hash; now the key is at most 64-byte long.
Start a SHA-256 hash.
Set a 64-bytes buffer to all 0x36; XOR the key into that buffer (leaving unchanged any byte past the key length); hash that buffer.
Hash the blocks of data to authenticate (as several blocks if necessary).
Finalize the hash of steps 2/3/4, giving the 32-byte T.
Start another SHA-256 hash.
Set a 64-bytes buffer to all 0x5c; XOR the key into that buffer (leaving unchanged any byte past the key length); hash that buffer.
Hash the 32-byte T.
Finalize the hash of steps 6/7/8, giving the desired 32-byte result.


That simply applies the definition of HMAC.