Here we shortly review some math background. Namely, exponentiation, logarithm, xor, and modulo.
XOR or exclusive or, is one of the widely used logic operators, especially in cryptography. It is usually shown with ⊕. XOR is a binary operator and the value of operation is 1, when only one of the operands is 1.
Module operation gives us the remainder of division. We use mod or % as notation.
a = b * n + c
a % b = c
a % n = c
A few numerical examples:
Exponentiation is a mathematical operation involving two numbers, represented as $b^n$. Where b is the base, and n is power or exponent. It simply translates into multiplying $b$, $n$ times by it self.
$2 ^ 3$ = 2 * 2 * 2
Logarithm is the inverse operation of exponentiation. If $a = b^n$, then $ \log_b a$, is to find how many times the base ($b$), needs to be mulitplied by itself to produce $a$.
If $a = 16 = 2^4$, then:
$log_2 16 = 4$