idnits 2.17.1 draft-jivsov-ecc-compact-00.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (December 10, 2012) is 4154 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- No issues found here. Summary: 0 errors (**), 0 flaws (~~), 1 warning (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Workign Group A. Jivsov 3 Internet-Draft Symantec Corporation 4 Intended status: Informational December 10, 2012 5 Expires: June 13, 2013 7 Compact representation of an elliptic curve point 8 draft-jivsov-ecc-compact-00 10 Abstract 12 This document defines a format for efficient storage representation 13 of an elliptic curve point over prime fields, suitable for use with 14 any IETF format or protocol. 16 Status of this Memo 18 This Internet-Draft is submitted in full conformance with the 19 provisions of BCP 78 and BCP 79. 21 Internet-Drafts are working documents of the Internet Engineering 22 Task Force (IETF). Note that other groups may also distribute 23 working documents as Internet-Drafts. The list of current Internet- 24 Drafts is at http://datatracker.ietf.org/drafts/current/. 26 Internet-Drafts are draft documents valid for a maximum of six months 27 and may be updated, replaced, or obsoleted by other documents at any 28 time. It is inappropriate to use Internet-Drafts as reference 29 material or to cite them other than as "work in progress." 31 This Internet-Draft will expire on June 13, 2013. 33 Copyright Notice 35 Copyright (c) 2012 IETF Trust and the persons identified as the 36 document authors. All rights reserved. 38 This document is subject to BCP 78 and the IETF Trust's Legal 39 Provisions Relating to IETF Documents 40 (http://trustee.ietf.org/license-info) in effect on the date of 41 publication of this document. Please review these documents 42 carefully, as they describe your rights and restrictions with respect 43 to this document. Code Components extracted from this document must 44 include Simplified BSD License text as described in Section 4.e of 45 the Trust Legal Provisions and are provided without warranty as 46 described in the Simplified BSD License. 48 Table of Contents 50 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 51 2. Conventions used in this document . . . . . . . . . . . . . . 3 52 3. Overview of the compact representation in IETF protocols . . . 3 53 4. The definition of the compact representation . . . . . . . . . 4 54 4.1. Encoding and decoding of an elliptic curve point . . . . . 5 55 4.2. The algorithms to generate a key pair . . . . . . . . . . 5 56 4.2.1. The black box key generation algorithm . . . . . . . . 6 57 4.2.2. The deterministic key generation algorithm . . . . . . 6 58 4.3. The efficient square root algorithm for p=4*k+3 . . . . . 7 59 5. Interoperability considerations . . . . . . . . . . . . . . . 7 60 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 8 61 7. Security Considerations . . . . . . . . . . . . . . . . . . . 8 62 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 10 63 8.1. Normative References . . . . . . . . . . . . . . . . . . . 10 64 8.2. Informative References . . . . . . . . . . . . . . . . . . 10 65 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 11 67 1. Introduction 69 The National Security Agency (NSA) of the United States specifies 70 elliptic curve cryptography (ECC) for use in its [SuiteB] set of 71 algorithms. The NIST elliptic curves over the prime fields 72 [FIPS-186], which include [SuiteB] curves, or the Brainpool curves 73 [RFC5639] are the examples of curves over prime fields. 75 This document provides an efficient format for compact representation 76 of a point on an elliptic curve over a prime field. It is intended 77 as an open format that other IETF protocols can rely on to minimize 78 space required to store an ECC point. This document complements the 79 [RFC6090] with the on-the-wire definition of an ECC point. 81 One of the benefits of the ECC is the small size of field elements. 82 The compact representation reduces the encoded size of an ECC element 83 in half, which can be a substantial saving in cases such as 84 encryption of a short message sent to multiple recipients. 86 2. Conventions used in this document 88 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 89 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 90 document are to be interpreted as described in [RFC2119]. 92 3. Overview of the compact representation in IETF protocols 94 IETF protocols often use the [SEC1] representation of a point on an 95 elliptic curve, which is a sequence of the following fields: 97 Field Description 98 ------ -------------------------------------------------------------- 99 B0 {02, 03, 04}, where 02 or 03 represent a compressed point (x 100 only), while 04 represents a complete point (x,y) 101 X x coordinate of a point 102 Y y coordinate of a point, optional (present only for B0=04) 104 SEC1 point representation 106 The [SEC1] is an example of a general-purpose elliptic curve point 107 compression. The idea behind these methods is the following: 109 o For the given point P=(x,y) the y coordinate can be derived from x 110 by solving the corresponding equation of the ECC. 112 o There are two possible y coordinates for any x of a given P 114 o The either of the two possibilities for y is encoded in some way 115 in the compressed representation 117 There are a few undesirable properties of the above representation: 119 o The requirement to store one bit to identify the 'y' means that 120 the whole byte is required. 122 o For most well-known elliptic curves the extra byte removes the 123 power of two alignment for the encoded point. 125 o The requirement for the balanced security calls for the ECC curve 126 size to be equal the hash output size, yet the storage length of 127 the ECC point is equal to the hash output size + 1. 129 o The encoded point is not a multi-precision integer, but a 130 structured sequence of bytes. For example, special wording is 131 required to define the encoding of the [FIPS-186] P-521 to clarify 132 how odd number of bits for x and y, or a bit representing y, are 133 packed into bytes. 135 o Some protocols, such as ECDH, don't depend on the exact value of 136 the y. It is unnecessary to track the precise point P=(x,y) in 137 such protocols. 139 4. The definition of the compact representation 141 This document is an improvement to the idea by [Miller] to not 142 transmit the y coordinate of an ECC point in the elliptic curve 143 Diffie-Hellman (ECDH) protocol. 145 We will use the following notations for the ECC point Q and the 146 features of the corresponding elliptic curve: 148 Q = k*G, where 150 Q = (x,y) is the point on an elliptic curve (the canonical 151 represenation) 153 k - the private key (a scalar) 155 G - the elliptic curve generator point 157 y^2 = x^3 + a*x + b is the standard Weierstrass equation linking x 158 and y 159 p - the order of the underlying finite field to which x and y 160 belong 162 Ord - the order of the elliptic curve field, i.e. the number of 163 points on the curve ( Ord*G = O, where O is the identity element ) 165 Q is a point that we need to represent in the compact form. The 166 integer operations considered in this document are performed modulo 167 prime p and "(mod p)" is assumed in every formula with x and y. 169 The steps to create and interpret the compact representation of a 170 point are described next. A special key generation algorithm is 171 needed to make them possible, defined later in Section 4.2. 173 4.1. Encoding and decoding of an elliptic curve point 175 Encoding: Given the canonical representation of Q=(x,y), return the 176 x as the compact representation. 178 Decoding: Given the compact representation of Q, return canonical 179 representation of Q=(x,y) as follows: 181 1. y' = sqrt( x^3 + a*x + b ), where y'>0 183 2. y = min(y',p-y') 185 3. Q=(x,y) is the canonical representation of the point 187 Recall that the x is an integer in the underlying finite field. Its 188 precise encoding SHOULD be consistent with encoding of other multi- 189 precision integers in the application, for example, it would be the 190 same encoding as used for the r or s integer that is a part of the 191 DSA signature and it is typically a sequence of big-endian bytes. 193 The efficient algorithm to recover y for [SuiteB] or the Brainpool 194 curves [RFC5639], among others, is given in Section 4.3. 196 min(y,p-y) can be calculated with the help of the pre-calculated 197 value p2=(p-1)/2. min(y,p-y) is y if y. 414 [Lehmer] Lehmer, D., "Computer technology applied to the theory of 415 numbers", 1969. 417 [Miller] Miller, V., "Use of elliptic curves in cryptography", 418 Proceedings Lecture notes in computer sciences; 218 on 419 Advances in cryptology -- CRYPTO 85, June 1986. 421 [NIST-SP800-133] 422 National Institute of Standards and Technology, 423 "Recommendation for Cryptographic Key Generation", SP 800- 424 133, November 2012, 425 . 427 [NIST-SP800-56A] 428 National Institute of Standards and Technology, 429 "Recommendation for Pair-Wise Key Establishment Schemes 430 Using Discrete Logarithm Cryptography", SP 800-56A 431 Revision 1, March 2007, 432 . 434 [RFC5639] Lochter, M. and J. Merkle, "Elliptic Curve Cryptography 435 (ECC) Brainpool Standard Curves and Curve Generation", 436 RFC 5639, March 2010. 438 [RFC6090] McGrew, D., Igoe, K., and M. Salter, "Fundamental Elliptic 439 Curve Cryptography Algorithms", RFC 6090, February 2011. 441 [SEC1] STANDARDS FOR EFFICIENT CRYPTOGRAPHY, "SEC 1: Elliptic 442 Curve Cryptography", September 2000, . 445 [SuiteB] National Security Agency, "NSA Suite B Cryptography", 446 March 2010, 447 . 449 Author's Address 451 Andrey Jivsov 452 Symantec Corporation 454 Email: openpgp@brainhub.org