%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Copyright: 2010 Integrated Sytems Laboratory, ETH Zurich %% http://www.iis.ee.ethz.ch/~sha3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function new_lfsr=counter(lfsr) if ~isequal(bitand(lfsr,hex2dec('80')),0) new_lfsr=bitxor(bitshift(lfsr,1), hex2dec('71')); else new_lfsr=bitshift(lfsr,1); end end