Adding logic to init and update digest register. Integrating control into FSM.