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