%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Copyright: 2010 Integrated Sytems Laboratory, ETH Zurich %% http://www.iis.ee.ethz.ch/~sha3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function state = tweak(state, statewidth) for j=0:statewidth-1 for i=5:8 state(8*j+i) = bitor(bitshift(state(8*j+i), j), bitshift(state(8*j+i), j-32)); end end end