%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Copyright: 2010 Integrated Sytems Laboratory, ETH Zurich %% http://www.iis.ee.ethz.ch/~sha3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function out=reverse(s) out=zeros(1,25,'uint64'); for i=1:25 tmp0=dec2hex(uint32(bitand(bitshift(s(i),-32),2^32-1)),8); tmp1=dec2hex(uint32(bitand(s(i),2^32-1)),8); hex= cat(2,tmp0,tmp1); hex=towords(hex,64); out(i)=hex2dec64(hex); % if i==1 % out=hex; % else % out=cat(2,out,hex); % end end end