Circular shift an arbitrary byte-array bitwise
C 89

Shifting is done in-place in *s array. l is array length and f is number of bits to shift.

void f(char*s,l,f){while(f--)for(int i=0,j,c=*s&lt;0;s[j=i++]&lt;&lt;=1,s[j]+=i%l?s[i]&lt;0:c,i&lt;l;);}