Given the result of an XOR operation and one of the operands involved in said operation, how can I go about finding the other operand? Specifically, given the knowledge that x = a ^ b and the value of x and a, how can I find b?
Given the result of an XOR operation and one of the operands involved in said operation, how can I go about finding the other operand? Specifically, given the knowledge that x = a ^ b and the value of x and a, how can I find b?
We have that:
x = a ^ b
==> x ^ a = a ^ b ^ a
==> x ^ a = (a ^ a) ^ b
==> x ^ a = 0 ^ b
==> x ^ a = b
So, to recover b, you can do:
x ^ a