Why does SHA-1 rotate the variables A and B?

SHA-1 has an operation within round j in stage t, where the functions $f_t$ and $K_t$ change depending on the stage.

Is there a specific reason why the variable $A$ is rotated by 5? How does this improve security? And why not rotate the variable by 30 like $B$ is?

I have the same question about $B$: why is the variable rotated and why isn't it rotated by a different amount?

Most the other operations you see in the round – XORs and $f_t$ – are bitwise functions. Without rotations every bit would only affect the corresponding bits in the other words and the higher bits in some words due to carry propagation. That means the low order bit would be affected by only the low order bits of the inputs $W_j$ and $K_t$, allowing simple inversion in the case of SHA-0 (where $W_j$ themselves are straight up combinations of input words) and significantly weaken SHA-1 (where $W_j$ are rotated).
• Thanks! Do you also know why the variable $B$ was chosen to rotate over, for example, $C$ or $D$? – Cartman123 Aug 28 '16 at 8:33