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