3

There are rules for modulo operation involving summation, multiplication and division. For example:

(A + B) % P = (A % P + B % P) % P
(A * B) % P = (A % P * B % P) % P
(A / B) % P = ((A % P) * (B^(-1) % P)) % P

where % means modulo operation and B^(-1) means modulo multiplicative inverse.

I would like to know whether there are any formulas related to bitwise xor operation (16 ^ 3 = 19, 5 ^ 7 = 2). I thought that there might exist anything like:

(A ^ B) % P = (A % P ^ B % P) % P

which is clearly not the case. So are there any formulas involving xor, multiplication, summation and modulo?

1 Answers1

3

Seeing as how xor is a bitwise operation and modulo is not bitwise, there is probably no nice equation relating them, unless P is a power of 2, in which case the identity (A ^ B) % P = A % P ^ B % P is obvious.

msinghal
  • 1,699