Is it possible to combine two operations rotation and xor? I can see many xor and rotation operations in cryptography. I just want to make some algorithms fast. So, I'm looking for a way to combine between xor rotation operations. I don't know if it is possible or not.

R3(A) xor R4(B) = A * B (R3,R4 means left rotate shift by 3 bits and 4 bits)


I'm looking for *. Is there any idea? If you have please, let me know. And if it is impossible, please show me why. Thanks.
The question asks for simple variations of the $*$ operations defined by formulas similar to $A*B=(A\lll3)\oplus(B\lll4)$ or $A*B=(A\lll3)\oplus(B\ggg4)$, where uppercase letters are words of $n=32$ bits, lowercase letters are integers, $\lll$ designates left rotation, $\ggg$ designates right rotation, $\oplus$ designates eXclusive-OR.

There are a number of properties we can use:
$$\begin{align*}
\forall X, \forall Y,           &amp;&amp;X\oplus Y          &amp;=Y\oplus X\\
\forall X, \forall Y, \forall Z,&amp;&amp;(X\oplus Y)\oplus Z&amp;=X\oplus(Y\oplus Z)\\
\forall X, \forall Y, \forall u,&amp;&amp;(X\oplus Y)\lll u  &amp;= (X\lll u)\oplus(Y\lll u)\\
\forall X, \forall u, \forall v,&amp;&amp;(X\lll u)\lll v    &amp;= X\lll((u+v)\bmod n)\\
\forall X, \forall u,           &amp;&amp;X\ggg u            &amp;= X\lll((-u)\bmod n)
\end{align*}$$
where $a\bmod n$ is defined to be the $r$ such that $0\le r&lt;n$ and $n$ divides $a-r$.

It follows that
$$\begin{align*}
(A\lll3)\oplus(B\lll4)&amp;=(A\oplus (B\lll1))\lll3\\
                      &amp;=((B\lll1)\oplus A)\lll3\\
                      &amp;=((A\ggg1)\oplus B)\lll4
\end{align*}$$
which can be considered a simplification (in particular, absent a smart compiler, some of these alternate forms will likely be faster on 8-bit CPUs, and 32-bit CPUs lacking a barrel shifter)

Similarly we can write
$$\begin{align*}
(A\lll3)\oplus(B\ggg4)&amp;=((B\ggg7)\oplus A)\lll3\\
                      &amp;=(A\oplus (B\ggg7))\lll3\\
                      &amp;=((A\lll7)\oplus B)\ggg4\\
                      &amp;=(((A\lll8)\ggg1)\oplus B)\ggg4
\end{align*}$$
with the last form geared for 8-bit CPUs, where rotation by multiples of 8 is relatively efficient.



There's no way to simplify $((A\ggg3)\boxplus(B\lll4))\lll4$, or $((A\oplus B)\boxplus(C\oplus D))\oplus E$, where $\boxplus$ is addition modulo $2^n$. Problem is, we have no simple exact properties of $\boxplus$ with respect to $\lll$, $\ggg$, and $\oplus$.