/* Finalize the running hash to make digest. 
This function empties the internal buffer, adds padding bits, and generates final digest. */
static status_t dcp_hash_finalize(DCP_Type *base, dcp_hash_ctx_internal_t *ctxInternal)
/* Finalize the running hash to make digest. 
This function empties the internal buffer, adds padding bits, and generates final digest. */
static status_t dcp_hash_finalize(DCP_Type *base, dcp_hash_ctx_internal_t *ctxInternal)
{
    status_t status;
    ctxInternal->ctrl0 |= (uint32_t)kDCP_CONTROL0_HASH_TERM;
    status = dcp_hash_update(base, ctxInternal, &ctxInternal->blk.b[0], ctxInternal->blksz);
    return status;
}