diff --git a/src/exclusive-or.rst b/src/exclusive-or.rst index a44bb5fd..2b5ceae5 100644 --- a/src/exclusive-or.rst +++ b/src/exclusive-or.rst @@ -4,30 +4,30 @@ Exclusive or Description ~~~~~~~~~~~ -Exclusive or, often called “XOR”, is a Boolean [#boolean]_ binary [#binary]_ operator -that is true when either the first input or the second input, but not +Exclusive also known as “XOR” is a Boolean [#boolean]_ binary [#binary]_ operator. +XOR is true when either the first input or the second input, but not both, are true. -Another way to think of XOR is as something called a “programmable -inverter”: one input bit decides whether to invert the other input bit, -or to just pass it through unchanged. “Inverting” bits is colloquially -called “flipping” bits, a term we'll use often throughout the book. +XOR can be thought of as a “programmable +inverter.” One input bit decides whether to invert another input bit, +or to pass it through unchanged. “Inverting” bits is colloquially +called “flipping” bits. Flipping bits is a term we use often throughout the book. .. figure:: Illustrations/XOR/ProgrammableInverter.svg :alt: a programmable inverter :align: center -In mathematics and cryptography papers, exclusive or is generally -represented by a cross in a circle: :math:`\xor`. We'll use the same +In mathematics and cryptography papers, exclusive or XOR is +represented by a cross in a circle: :math:`\xor`. We use the same notation in this book: .. figure:: Illustrations/XOR/XOR.svg :align: center :alt: XOR -The inputs and output here are named as if we're using XOR as an +The inputs and outputs are named as if XOR is an encryption operation. On the left, we have the plaintext bit -:math:`P_i`. The :math:`i` is just an index, since we'll usually deal +:math:`P_i`. The :math:`i` is an index, since we will usually deal with more than one such bit. On top, we have the key bit :math:`k_i`, that decides whether or not to invert :math:`P_i`. On the right, we have the ciphertext bit, :math:`C_i`, which is the result of the XOR @@ -42,9 +42,9 @@ operation. A few properties of XOR ~~~~~~~~~~~~~~~~~~~~~~~ -Since we'll be dealing with XOR extensively during this book, we'll take -a closer look at some of its properties. If you're already familiar with -how XOR works, feel free to skip this section. +Lets take a closer look at the properties of XOR since +we deal with it extensively in this book. Feel free to skip this section +if you are already familiar with XOR. We saw that the output of XOR is 1 when one input or the other (but not both) is 1: @@ -56,7 +56,7 @@ both) is 1: 0 \xor 1 = 1 & 1 \xor 1 = 0 \end{array} -There are a few useful arithmetic tricks we can derive from that. +A few useful arithmetic tricks can be derived from this. #. You can apply XOR in any order: :math:`a \xor (b \xor c) = (a \xor b) \xor c`