moved processKey after process was called, to have always a fresh buffer for key calculation