From 43df5ae3bb43ba8ef153424f9985fd67a29145f7 Mon Sep 17 00:00:00 2001 From: nadams Date: Thu, 18 May 2017 08:09:15 -0700 Subject: [PATCH] Edited ch04.asciidoc with Atlas code editor --- ch04.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ch04.asciidoc b/ch04.asciidoc index bddae2be..b146a884 100644 --- a/ch04.asciidoc +++ b/ch04.asciidoc @@ -481,7 +481,7 @@ As we saw in the section <>, a public key is a point (x,y) on an ellipti Whereas uncompressed public keys have a prefix of +04+, compressed public keys start with either a +02+ or a +03+ prefix. Let's look at why there are two possible prefixes: because the left side of the equation is __y__^2^, the solution for _y_ is a square root, which can have a positive or negative value. Visually, this means that the resulting _y_ coordinate can be above or below the x-axis. As you can see from the graph of the elliptic curve in <>, the curve is symmetric, meaning it is reflected like a mirror by the x-axis. So, while we can omit the _y_ coordinate we have to store the _sign_ of _y_ (positive or negative); or in other words, we have to remember if it was above or below the x-axis because each of those options represents a different point and a different public key. When calculating the elliptic curve in binary arithmetic on the finite field of prime order p, the _y_ coordinate is either even or odd, which corresponds to the positive/negative sign as explained earlier. Therefore, to distinguish between the two possible values of _y_, we store a compressed public key with the prefix +02+ if the _y_ is even, and +03+ if it is odd, allowing the software to correctly deduce the _y_ coordinate from the _x_ coordinate and uncompress the public key to the full coordinates of the point. Public key compression is illustrated in <>. [[pubkey_compression]] -[role="smallerseventyfive"] +[role="smallerseventy"] .Public key compression image::images/mbc2_0407.png["pubkey_compression"]