From fb1c4eb6c1a76090ac54737246bb30a018f18012 Mon Sep 17 00:00:00 2001 From: nktrejo2020 <69374108+nktrejo2020@users.noreply.github.com> Date: Sat, 26 Sep 2020 13:47:57 -0700 Subject: [PATCH 1/2] Update exclusive-or.rst --- src/exclusive-or.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/exclusive-or.rst b/src/exclusive-or.rst index a44bb5fd..13321cd7 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'll 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 From f836db3d0ef7ce87874107a52e4fb58b4c0c04b0 Mon Sep 17 00:00:00 2001 From: nktrejo2020 <69374108+nktrejo2020@users.noreply.github.com> Date: Sun, 27 Sep 2020 08:55:03 -0700 Subject: [PATCH 2/2] Update exclusive-or.rst --- src/exclusive-or.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/exclusive-or.rst b/src/exclusive-or.rst index 13321cd7..2b5ceae5 100644 --- a/src/exclusive-or.rst +++ b/src/exclusive-or.rst @@ -27,7 +27,7 @@ notation in this book: 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 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`