lib_hash_drbg/src/sha256.c
/*
 * Update the sha256 context with the input data as a byte array
 *  Read data one byte at a time, and store it into an internal buffer
 *  in the Context.  When 64 bytes (512 bits) are stored, call sha256_transform
 *  to consume the bytes, and clear the buffer. The buffer may be left partially
 *  full when the last of the input data has been consumed.
 *  Update the message length as input data is read.
 *
 * Parameters:
 * SHA256_CTX* context - structure holding the sha256 context
 * uint8_t* data       - input data buffer to be hashed
 * uint32_t length     - size of input data buffer
 */
Update the sha256 context with the input data as a byte array
Read data one byte at a time, and store it into an internal buffer
in the Context.  When 64 bytes (512 bits) are stored, call sha256_transform
to consume the bytes, and clear the buffer. The buffer may be left partially
full when the last of the input data has been consumed.
Update the message length as input data is read.

SHA256_CTX* context - structure holding the sha256 context
uint8_t* data       - input data buffer to be hashed
uint32_t length     - size of input data buffer
Update the sha256 context with the input data as a byte array Read data one byte at a time and store it into an internal buffer in the Context . When 64 bytes ( 512 bits ) are stored call sha256_transform to consume the bytes and clear the buffer . The buffer may be left partially full when the last of the input data has been consumed . Update the message length as input data is read . SHA256_CTX * context - structure holding the sha256 context uint8_t * data - input data buffer to be hashed uint32_t length - size of input data buffer
void
sha256_update(SHA256_CTX* context, const uint8_t* data, uint32_t length)
{
    uint32_t i;
    for (i = 0; i < length; i += 1) {
        context->data[context->datalen++] = data[i];
        context->bitlen += 8;
        if (context->datalen == 64) {
            sha256_transform(context);
            context->datalen = 0;
        }
    }
}
void sha256_update ( SHA256_CTX * context , const uint8_t * data , uint32_t length ) { uint32_t i ; for ( i = 0 ; i < length ; i += 1 ) { context -> data [ context -> datalen ++ ] = data [ i ] ; context -> bitlen += 8 ; if ( context -> datalen == 64 ) { sha256_transform ( context ) ; context -> datalen = 0 ; } } }
Update the sha256 context with the input data as a byte array
  Read data one byte at a time, and store it into an internal buffer
  in the Context.
Update the sha256 context with the input data as a byte array Read data one byte at a time and store it into an internal buffer in the Context .
/*
     * Copy the input data to the internal context buffer
     */ /*
         * Update the bit length, for each byte processed
         */ /*
         * And when the context buffer is full, call sha256_transform
         */