Expanded first sha_process function.