>> c0 = input_carry; >> for(i=LENGTH;i>0;--i) { >> *p++ = ((c1 = (*p & 0x80)) << 1) + c0; >> c0 = c1; >> } > >this doesn't. It looks like this'll only write one bit to each byte. I think that it works ;-), excepting for the oops with c1 inside the assignment. Ought to be: c0 = input_carry; for(i=LENGTH;i>0;--i) { c1 = *p & 0x80; *p++ = (*p << 1) + c0; c0 = c1; } It rotates the shift register stored in the vector up by 1 bit (left). I gave 2 solutions because 'rotating' is ambiguous in meaning. It could be rotating bits, a matrix, or some other usual target (like serial data). Peter -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.