%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Copyright: 2010 Integrated Sytems Laboratory, ETH Zurich %% http://www.iis.ee.ethz.ch/~sha3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [s] = s2(x) a = [0 0 x(1:30)]; b = [x(2:32) 0]; c = circshift(x,[0 -12]); d = circshift(x,[0 -25]); s = xor(xor(a,b),xor(c,d));