0

How could I open parentheses which have an addition inside and a bitwise xor outside?

I have a system of equations:

$$ \left\{ \begin{array}{c} y - x = c \\ y \oplus x = d \end{array} \right. $$

$x, y$ - positive (32bit) integer variables, which I want to find.

$c, d$ - integer constants.

$\oplus$ - bitwise xor.

I can make a first step by showing that $y = c + x$ and so $(c+x) \oplus x = d$. How could I find the $x$ from the last equation?

I was able to come up with one more step. By applying the xor $x$ to both sides we get $c+x = d \oplus x$.

If there are any $c$ and $d$ for which it is impossible to solve the system, then you may just not consider such $c$ and $d$.

qqqqqqq
  • 101

0 Answers0