<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
     which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.
     There has to be one entity for each item to be referenced. 
     An alternate method (rfc include) is described in the references. -->

<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC2629 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2629.xml">
<!ENTITY RFC3279 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3279.xml">
<!ENTITY RFC3552 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3552.xml">
<!ENTITY RFC4050 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4050.xml">
<!ENTITY RFC4492 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4492.xml">
<!ENTITY RFC4754 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4754.xml">
<!ENTITY RFC5226 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5226.xml">
<!ENTITY RFC5480 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5480.xml">
<!ENTITY RFC5753 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5753.xml">
<!ENTITY RFC6347 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6347.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs), 
     please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
     (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="4"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space 
     (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="info" docName="draft-black-numscurves-02" ipr="trust200902">
  <!-- category values: std, bcp, info, exp, and historic
     ipr values: full3667, noModification3667, noDerivatives3667
     you can add the attributes updates="NNNN" and obsoletes="NNNN" 
     they will automatically be output with "(if approved)" -->

  <!-- ***** FRONT MATTER ***** -->

  <front>
    <!-- The abbreviated title is used in the page header - it is only necessary if the 
         full title is longer than 39 characters -->

    <title abbrev="ECC NUMS Curves and Curve Generation">Elliptic Curve Cryptography (ECC) Nothing Up My Sleeve (NUMS) Curves and Curve Generation</title>

    <author fullname="Benjamin Black" initials="B.B."
            surname="Black">
      <organization>Microsoft</organization>

      <address>
        <postal>
          <street>One Microsoft Way</street>

          <city>Redmond</city>

          <region>WA</region>

          <code>98115</code>

          <country>US</country>
        </postal>

        <email>benblack@microsoft.com</email>
      </address>
    </author>

    <author fullname="Joppe W. Bos" initials="J.B."
            surname="Bos">
      <organization>NXP Semiconductors</organization>

      <address>
        <postal>
          <street>Interleuvenlaan 80</street>
          
          <city>3001 Leuven</city>

          <country>Belgium</country>
        </postal>

        <email>joppe.bos@nxp.com</email>
      </address>
    </author>

    <author fullname="Craig Costello" initials="C.C."
            surname="Costello">
      <organization>Microsoft Research</organization>

      <address>
        <postal>
          <street>One Microsoft Way</street>

          <city>Redmond</city>

          <region>WA</region>

          <code>98115</code>

          <country>US</country>
        </postal>

        <email>craigco@microsoft.com</email>
      </address>
    </author>

    <author fullname="Patrick Longa" initials="P.L."
            surname="Longa">
      <organization>Microsoft Research</organization>

      <address>
        <postal>
          <street>One Microsoft Way</street>

          <city>Redmond</city>

          <region>WA</region>

          <code>98115</code>

          <country>US</country>
        </postal>

        <email>plonga@microsoft.com</email>
      </address>
    </author>

    <author fullname="Michael Naehrig" initials="M.N."
            surname="Naehrig">
      <organization>Microsoft Research</organization>

      <address>
        <postal>
          <street>One Microsoft Way</street>

          <city>Redmond</city>

          <region>WA</region>

          <code>98115</code>

          <country>US</country>
        </postal>

        <email>mnaehrig@microsoft.com</email>
      </address>
    </author>

    <date month="August" year="2014" />

    <!-- Meta-data Declarations -->

    <area>General</area>

    <workgroup>Network Working Group</workgroup>

    <keyword>elliptic curve</keyword>
    <keyword>cryptography</keyword>
    <keyword>ecc</keyword>
    <keyword>tls</keyword>
    <keyword>nums</keyword>

    <!-- Keywords will be incorporated into HTML output
         files in a meta tag but they have no effect on text or nroff
         output. If you submit your draft to the RFC Editor, the
         keywords will be used for the search engine. -->

    <abstract>
      <t>This memo describes a family of deterministically generated Nothing Up My Sleeve (NUMS) elliptic curves over prime fields offering high practical security in cryptographic applications, including Transport Layer Security (TLS) and X.509 certificates. The domain parameters are defined for both classical Weierstrass curves, for compatibility with existing applications, and modern twisted Edwards curves, allowing further efficiency improvements for a given security level.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>Since the initial standardization of elliptic curve cryptography (ECC) in <xref target="SEC1" /> there has been significant progress related to both efficiency and security of curves and implementations. Notable examples are algorithms protected against certain side-channel attacks, different 'special' prime shapes which allow faster modular arithmetic, and a larger set of curve models from which to choose. There is also concern in the community regarding the generation and potential weaknesses of the curves defined in <xref target="NIST"/>.</t>

      <t>This memo describes a set of elliptic curves for cryptography, defined in <xref target="MSR" /> which have been specifically chosen to support constant-time, exception-free scalar multiplications that are resistant to a wide range of side-channel attacks including timing and cache attacks, thereby offering high practical security in cryptographic applications. These curves are deterministically generated based on algorithms defined in this document and without any hidden parameters or reliance on randomness, hence they are called Nothing Up My Sleeve (NUMS) curves. The domain parameters are defined for both classical Weierstrass curves, for compatibility with existing applications while delivering better performance and stronger security, and modern twisted Edwards curves, allowing even further efficiency improvements for a given security level.</t>

      <section title="Requirements Language">
        <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
        "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
        document are to be interpreted as described in <xref
        target="RFC2119">RFC 2119</xref>.</t>
      </section>
    </section>

    <section title="Scope and Relation to Other Specifications">
      <t>This RFC specifies elliptic curve domain parameters over prime fields GF(p) with p having a length of 256, 384, and 512 bits, in both Weierstrass and twisted Edwards form. These parameters were generated in a transparent and deterministic way and have been shown to resist current cryptanalytic approaches. Furthermore, this document identifies the security and implementation requirements for the parameters, and describes the methods used for the deterministic generation of the parameters.</t>

      <t>This document also describes use of the specified parameters in X.509 certificates, in accordance with <xref target="RFC3279" /> and <xref target="RFC5480" />. It does not address the cryptographic algorithms to be used with the specified parameters nor their application in other standards. However, it is consistent with the following RFCs that specify the usage of ECC in protocols and applications:</t>

      <t>
        <list style="symbols">
          <t><xref target="RFC4050" /> for XML signatures</t>
          <t><xref target="RFC4492" /> for TLS</t>
          <t><xref target="RFC4754" /> for IKE</t>
          <t><xref target="RFC5753" /> for cryptographic message syntax (CMS)</t>
        </list>
      </t>
    </section>

    <section title="Requirements">
      <section anchor="technical-requirements" title="Technical Requirements">
        <t>
          <list style="numbers">
            <t>Applicability to multiple cryptographic algorithms without transformation, in particular key exchange, e.g. Elliptic Curve Diffie-Hellman (ECDH), and digital signature algorithms, e.g., (ECDSA), Schnorr.</t>
            <t>Multiple security levels using the same curve generation algorithm with only a security parameter change. The curve generation algorithm must be extensible to any security level.</t>
            <t>Ability to use pre-computation for increased performance. In particular, speed-up in key generation is important when a curve is used with ephemeral key exchange algorithm, such as ECDHE.</t>
            <t>The bit length of prime and order of curves for a given security level MUST be divisible by 8. Specifically, constructions such as NIST P-521 are to be avoided as they introduce interoperability and implementation problems.</t>
          </list>
        </t>
      </section>
      <section anchor="security-requirements" title="Security Requirements">
        <t>For each curve type (twisted Edwards or Weierstrass) at a specific specific security level:</t>
        <t>
          <list style="numbers">
            <t>The domain parameters SHALL be generated in a simple, deterministic manner, without any secret or random inputs. The derivation of the curve parameters is defined in <xref target="generation" />.</t>
            <t>The curve SHALL NOT restrict the scalars to a small subset. Using full-set scalars prevents implementation pitfalls that might otherwise go unnoticed.</t>
            <t>The curve selection SHALL include prime order curves with cofactor 1 only. Composite order curves require changes in protocols and in implementations. Additionally, implementations for composite order curves must thwart subgroup attacks.</t>
            <t>The trace of Frobenius MUST NOT be in {0, 1} in order to rule out the attacks described in <xref target="Smart" />, <xref target="AS" />, and <xref target="S" />, as in <xref target="EBP" />.</t>
            <t>MOV Degree: the embedding degree k MUST be greater than (r - 1) / 100, as in <xref target="EBP" />.</t>
            <t>CM Discriminant: discriminant D MUST be greater than 2^100, as in <xref target="SC" />.</t>
         </list>
        </t>
      </section>
    </section>

    <section anchor="notation" title="Notation">
      <t>Throughout this document, the following notation is used:</t>
      <figure align="center" suppress-title="true">
        <artwork align="left"><![CDATA[
      s: Denotes the bit length, here s in {256,384,512}.
      p: Denotes the prime number defining the base field.
      c: A positive integer used in the representation of the prime 
         p = 2^s - c.
  GF(p): The finite field with p elements.
      b: An element in the finite field GF(p), different from -2,2.
     Eb: The elliptic curve Eb/GF(p): 
                y^2 = x^3 - 3x + b 
         in short Weierstrass form, defined over GF(p) by the 
         parameter b.
     rb: The order rb = #Eb(GF(p)) of the group of GF(p)-rational 
         points on Eb.
     tb: The trace of Frobenius tb = p + 1 - rb of Eb.
    rb': The order rb' = #E'b(GF(p)) = p + 1 + tb of the group of
         GF(p)-rational points on the quadratic twist Eb': 
                y^2 = x^3 - 3x - b.
      d: An element in the finite field GF(p), different from -1,0.
     Ed: The elliptic curve Ed/GF(p): -x^2 + y^2 = 1 + dx^2y^2 in 
         twisted Edwards form, defined over GF(p) by the parameter d.
     rd: The subgroup order such that 4 * rd = #Ed(GF(p)) is the 
         order of the group of GF(p)-rational points on Ed.
     td: The trace of Frobenius td = p + 1 - 4 * rd of Ed.
    rd': The subgroup order such that 4 * rd' = #Ed'(GF(p)) = p + 1 + tb
         is the order of the group of GF(p)-rational points on the 
         quadratic twist Ed': 
                -x^2 = y^2 = 1 + (1 / d) * x^2 * y^2.
      P: A generator point defined over GF(p) either of prime order 
         rb in the Weierstrass curve Eb, or of prime order rd on the 
         twisted Edwards curve Ed.
   X(P): The x-coordinate of the elliptic curve point P.
   Y(P): The y-coordinate of the elliptic curve point P.
         ]]></artwork>
      </figure>
    </section>
    <section anchor="curve-params" title="Curve Parameters">
      <section anchor="curves-256" title="Parameters for 256-bit Curves">
        <figure align="center" suppress-title="false" title="Curve-Id: numsp256d1">
          <artwork align="left"><![CDATA[
    p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
          FFFFF43
    a = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
          FFFFF40
    b = 0x25581  
    r = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE43C8275EA265C6020AB20294
          751A825
 X(P) = 0x01
 Y(P) = 0x696F1853C1E466D7FC82C96CCEEEDD6BD02C2F9375894EC10BF46306C
          2B56C77
    h = 0x01 
          ]]></artwork>
        </figure>

        <figure align="center" suppress-title="false" title="Curve-Id: numsp256t1">
          <artwork align="left"><![CDATA[
    p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
          FFFFF43
    a = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
          FFFFF42 
    d = 0x3BEE  
    r = 0x3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBE6AA55AD0A6BC64E5B84E6F1
          122B4AD 
 X(P) = 0x0D 
 Y(P) = 0x7D0AB41E2A1276DBA3D330B39FA046BFBE2A6D63824D303F707F6FB53
          31CADBA
    h = 0x04 
          ]]></artwork>
        </figure>
      </section>

      <section anchor="curves-384" title="Parameters for 384-bit Curves">
        <figure align="center" suppress-title="false" title="Curve-Id: numsp384d1">
          <artwork align="left"><![CDATA[
    p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
          FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEC3 
    a = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
          FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEC0  
    b = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
          FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF77BB  
    r = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD61EAF1EE
          B5D6881BEDA9D3D4C37E27A604D81F67B0E61B9  
 X(P) = 0x02
 Y(P) = 0x3C9F82CB4B87B4DC71E763E0663E5DBD8034ED422F04F82673330DC58
          D15FFA2B4A3D0BAD5D30F865BCBBF503EA66F43
    h = 0x01 
          ]]></artwork>
        </figure>

        <figure align="center" suppress-title="false" title="Curve-Id: numsp384t1">
          <artwork align="left"><![CDATA[
    p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
          FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEC3 
    a = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
          FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEC2  
    d = 0x5158A 
    r = 0x3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFECD7D11ED
          5A259A25A13A0458E39F4E451D6D71F70426E25  
 X(P) = 0x08
 Y(P) = 0x749CDABA136CE9B65BD4471794AA619DAA5C7B4C930BFF8EBD798A8AE
          753C6D72F003860FEBABAD534A4ACF5FA7F5BEE
    h = 0x04 
          ]]></artwork>
        </figure>
      </section>

      <section anchor="curves-512" title="Parameters for 512-bit Curves">
        <figure align="center" suppress-title="false" title="Curve-Id: numsp512d1">
          <artwork align="left"><![CDATA[
    p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
          FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
          FFFFFFFFFFFDC7
    a = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
          FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
          FFFFFFFFFFFDC4
    b = 0x1D99B  
    r = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
          FFFFFFF5B3CA4FB94E7831B4FC258ED97D0BDC63B568B36607CD243CE
          153F390433555D  
 X(P) = 0x02
 Y(P) = 0x1C282EB23327F9711952C250EA61AD53FCC13031CF6DD336E0B932843
          3AFBDD8CC5A1C1F0C716FDC724DDE537C2B0ADB00BB3D08DC83755B20
          5CC30D7F83CF28 
    h = 0x01 
          ]]></artwork>
        </figure>

        <figure align="center" suppress-title="false" title="Curve-Id: numsp512t1">
          <artwork align="left"><![CDATA[
    p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
          FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
          FFFFFFFFFFFDC7
    a = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
          FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
          FFFFFFFFFFFDC6 
    d = 0x9BAA8 
    r = 0x3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
          FFFFFFFA7E50809EFDABBB9A624784F449545F0DCEA5FF0CB800F894E
          78D1CB0B5F0189 
 X(P) = 0x20
 Y(P) = 0x7D67E841DC4C467B605091D80869212F9CEB124BF726973F9FF048779
          E1D614E62AE2ECE5057B5DAD96B7A897C1D72799261134638750F4F0C
          B91027543B1C5E
    h = 0x04 
          ]]></artwork>
        </figure>
      </section>
    </section>

    <section anchor="x509" title="Object Identifiers and ASN.1 Syntax for X.509 Certificates">
      <section anchor="oids" title="Object Identifiers">
        <t>The root of the tree for the object identifiers defined in this specification is given by:</t>
      <figure align="center" suppress-title="true">
        <artwork align="left"><![CDATA[
      [TBDOID]
            ]]></artwork>
      </figure>
      <t>The following object identifiers represent the domain parameters for the curves defined in this draft:</t>
      <figure align="center" suppress-title="true">
        <artwork align="left"><![CDATA[
      numsp256d1 OBJECT IDENTIFIER ::= {versionOne 1}

      numsp256t1 OBJECT IDENTIFIER ::= {versionOne 2}

      numsp384d1 OBJECT IDENTIFIER ::= {versionOne 3}

      numsp384t1 OBJECT IDENTIFIER ::= {versionOne 4}

      numsp512d1 OBJECT IDENTIFIER ::= {versionOne 5}

      numsp512t1 OBJECT IDENTIFIER ::= {versionOne 6}
            ]]></artwork>
      </figure>

      </section>
      <section anchor="asn1" title="ASN.1 Syntax for X.509 Certificates">
        <t>The domain parameters for the curves specified in this RFC SHALL be used with X.509 certificates according to <xref target="RFC5480" />. Specifically, the algorithm field of subjectPublicKeyInfo MUST be one of:</t>
        <t>
          <list style="symbols">
            <t>id-ecPublicKey to indicate that the algorithms that can be used with the subject public key are unrestricted, as required for ECDSA, or</t>
            <t>id-ecDH to indicate that the algorithm that can be used with the subject public key is restricted to the ECDH key agreement algorithm, or</t>
            <t>id-ecMQV indicates that the algorithm that can be used with the subject public key is restricted to the Elliptic Curve Menezes-Qu-Vanstone (ECMQV) key agreement algorithm, and</t>
          </list>
        </t>
        <t>The field algorithm.parameter of subjectPublicKeyInfo MUST be of type namedCurve. No other values for this field are acceptable.</t>

      </section>
    </section>

    <!-- This PI places the pagebreak correctly (before the section title) in the text output. -->

    <?rfc needLines="8" ?>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>The authors would like to thank Brian Lamacchia and Tolga Acar for their help in the development of this draft.</t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>In addition to the discussion in the requirements, <xref target="MSR" />, <xref target="SC" />, and the other reference documents on EC security, users SHOULD match curves with cryptographic functions of similar strength. Specific recommendations for algorithms, per <xref target="RFC5480" /> are as follows:</t>
      <texttable anchor="strength_table" align="center">
        <ttcol align="center">Minimum Bits of Security</ttcol>

        <ttcol align="center">EC Key Size</ttcol>

        <ttcol align="center">Message Digest Algorithm</ttcol>

        <ttcol align="center">Curves</ttcol>

        <c>128</c><c>256</c><c>SHA-256</c><c>numsp256d1/t1</c>

        <c>192</c><c>384</c><c>SHA-384</c><c>numsp384d1/t1</c>

        <c>256</c><c>512</c><c>SHA-512</c><c>numsp512d1/t1</c>
      </texttable>
    </section>

    <section anchor="ipr" title="Intellectual Property Rights">
      <t>The authors have no knowledge about any intellectual property rights that cover the usage of the domain parameters defined herein. However, readers should be aware that implementations based on these domain parameters may require use of inventions covered by patent rights.</t>
    </section>

    <!-- Possibly a 'Contributors' section ... -->

    <section anchor="IANA" title="IANA Considerations">
      <t>IANA is requested to allocate an object identifier for elliptic curves under the PKIX root declared in <xref target="RFC5480"/>:</t>
      <figure align="center" suppress-title="true">
        <artwork align="left"><![CDATA[
  PKIX1Algorithms2008 { iso(1) identified-organization(3) dod(6)
    internet(1) security(5) mechanisms(5) pkix(7) id-mod(0) 45 }
            ]]></artwork>
      </figure>
      <t>IANA is further requested to allocate object identifiers under this new elliptic curve root for the named curves in <xref target="oids" />.</t>
    </section>
  </middle>

  <!--  *****BACK MATTER ***** -->

  <back>
    <!-- References split into informative and normative -->

    <!-- There are 2 ways to insert reference entries from the citation libraries:
     1. define an ENTITY at the top, and use "ampersand character"RFC2629; here (as shown)
     2. simply use a PI "less than character"?rfc include="reference.RFC.2119.xml"?> here
        (for I-Ds: include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")

     Both are cited textually in the same manner: by using xref elements.
     If you use the PI option, xml2rfc will, by default, try to find included files in the same
     directory as the including file. You can also define the XML_LIBRARY environment variable
     with a value containing a set of directories to search.  These can be either in the local
     filing system or remote ones accessed by http (http://domain/dir/... ).-->

    <references title="Normative References">
      <!--?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?-->
      &RFC2119;
    </references>

    <references title="Informative References">
      <!-- Here we use entities that we defined at the beginning. -->
      &RFC3279;

      &RFC3552;

      &RFC4050;

      &RFC4492;

      &RFC4754;

      &RFC5226;

      &RFC5480;

      &RFC5753;

      <!-- A reference written by by an organization not a person. -->

      <reference anchor="MSR"
                 target="http://eprint.iacr.org/2014/130.pdf">
        <front>
          <title>Selecting Elliptic Curves for Cryptography: An Efficiency and Security Analysis</title>
          <author initials="J.B." fullname="Joppe W. Bos" surname="Bos">
            <organization>Microsoft Research</organization>
          </author>
          <author initials="C.C." fullname="Craig Costello" surname="Costello">
            <organization>Microsoft Research</organization>
          </author>
          <author initials="P.L." fullname="Patrick Longa" surname="Longa">
            <organization>Microsoft Research</organization>
          </author>
          <author initials="M.N." fullname="Michael Naehrig" surname="Naehrig">
            <organization>Microsoft Research</organization>
          </author>
          <date day="19" month="February" year="2014" />
        </front>
      </reference>

      <reference anchor="ECCP"
                 target="https://eprint.iacr.org/2013/734">
        <front>
          <title>Elliptic Curve Cryptography in Practice</title>

          <author fullname="Joppe W. Bos" initials="J.B."
                  surname="Bos" />

          <author fullname="J. Alex Halderman" initials="J.H."
                  surname="Halderman" />

          <author fullname="Nadia Heninger" initials="N.H."
                  surname="Heninger" />

          <author fullname="Jonathan Moore" initials="J.M."
                  surname="Moore" />

          <author fullname="Michael Naehrig" initials="M.N."
                  surname="Naehrig" />

          <author fullname="Eric Wustrow" initials="E.W."
                  surname="Wustrow" />

          <date day="2" month="December" year="2013" />
        </front>
      </reference>

      <reference anchor="FPPR"
                 target="http://dx.doi.org/10.1007/978-3-642-29011-4_4">
        <front>
          <title></title>
          <author fullname="Jean-Charles Faugere" initials="J.F."
                  surname="Faugere" />

          <author fullname="Ludovic Perret" initials="L.P."
                  surname="Perret" />

          <author fullname="Christophe Petit" initials="C.P."
                  surname="Petit" />

          <author fullname="Guenael Renault" initials="G.R."
                  surname="Renault" />

          <date year="2012" />
        </front>
      </reference>

      <reference anchor="Smart">
        <front>
          <title>The discrete logarithm problem on elliptic curves of trace one</title>
          <author fullname="Nigel Smart" initials="N.S." surname="Smart" />
          <date year="1999" />
        </front>
      </reference>

      <reference anchor="AS">
        <front>
          <title>Fermat quotients and the polynomial time discrete log algorithm for anomalous elliptic curves</title>
          <author fullname="Takakazu Satoh" initials="T.S." surname="Satoh" />
          <author fullname="Kiyomichi Araki" initials="K.A." surname="Araki" />
          <date year="1998" />
        </front>
      </reference>

      <reference anchor="S">
        <front>
          <title>Evaluation of discrete logarithms on some elliptic curves</title>
          <author fullname="Igor Semaev" initials="I.S." surname="Semaev" />
          <date year="1998" />
        </front>
      </reference>

      <reference anchor="EBP" target="http://www.ecc-brainpool.org/download/Domain-parameters.pdf">
        <front>
          <title>ECC Brainpool Standard Curves and Curve Generation</title>
          <author>
            <organization>ECC Brainpool</organization>
          </author>
          <date day ="19" month="October" year="2005" />
        </front>
      </reference>

      <reference anchor="SC"
                 target="http://safecurves.cr.yp.to/">
        <front>
          <title>SafeCurves: choosing safe curves for elliptic-curve cryptography</title>
          <author fullname="Daniel J. Bernstein" initials="D.J.B." surname="Bernstein" />
          <author fullname="Tanja Lange" initials="T.J." surname="Lange" />
          <date day="28" month="June" year="2014" />
        </front>
      </reference>

      <reference anchor="NIST"
                 target="http://csrc.nist.gov/groups/ST/toolkit/documents/dss/NISTReCur.pdf">
        <front>
          <title>Recommended Elliptic Curves for Federal Government Use</title>

          <author>
            <organization>National Institute of Standards</organization>
          </author>

          <date month="July" year="1999" />
        </front>
      </reference>

      <reference anchor="SEC1"
                 target="http://www.secg.org/collateral/sec1_final.pdf">
        <front>
          <title>SEC 1: Elliptic Curve Cryptography</title>

          <author>
            <organization>Certicom Research</organization>
          </author>

          <date day="20" month="September" year="2000" />
        </front>
      </reference>

    </references>

    <section anchor="generation" title="Parameter Generation">
      <t>This section describes the generation of the curve parameters, namely the base
      field prime p, the curve parameters b and d for the Weierstrass and twisted
      Edwards curves, respectively, and a generator point P of the prime order
      subgroup of the elliptic curve.</t>

      <section anchor="prime-generation" title="Prime Generation">

        <t>For a given bitlength s in {256, 384, 512}, a prime p is selected
        as a pseudo-Mersenne prime of the form p = 2^s - c for a positive integer
        c. Each prime is determined by the smallest positive integer c such that
        p = 2^s - c is prime and p = 3 mod 4.</t>
        <figure align="center" title="GenerateP">
          <artwork align="left"><![CDATA[
Input: a bit length s in {256, 384, 512}
Output: a prime p = 2^s - c with p = 3 mod 4
  1. Set c = 1
  2. while (p = 2^s - c is not prime) do
       c = c + 4
     end while
  3. Output p
          ]]></artwork>
        </figure>
      </section>

      <section anchor="curve-generation" title="Deterministic Curve Parameter Generation">
        <section anchor="weierstrass-generation" title="Weierstrass Curves">
          <t>For a given bitlength s in {256, 384, 512} and a corresponding prime p = 2^s -
          c selected according to Section A.1, the elliptic curve Eb in short Weierstrass
          form is determined by the element b from GF(p), different from -2,2 with
          smallest absolute value (when represented as an integer in the interval
          [-(p - 1) / 2, (p - 1) / 2]) such that both group orders rb and rb' are prime, 
          and the group order rb &lt; p, i.e. tb &gt; 1. In addition, care must be taken to ensure the MOV degree and CM discriminant requirements from <xref target="security-requirements" /> are met.</t>
          <figure align="center" title="GenerateCurveWeierstrass">
            <artwork align="left"><![CDATA[
Input: a prime p = 2^s - c with p = 3 mod 4
Output: the parameter b defining the curve Eb
  1. Set b = 1
  2. while (rb is not prime or rb' is not prime) do
       b = b + 1
     end while
  3. if p + 1 < rb then
       b = -b
     end if
  4. Output b
            ]]></artwork>
          </figure>
        </section>
        <section anchor="twisted-edwards-generation" title="Twisted Edwards Curves">
          <t>For a given bitlength s in {256, 384, 512} and a corresponding prime p = 2^s -
          c selected according to Section A.1, the elliptic curve Ed in twisted Edwards
          form is determined by the element d from GF(p), different from -1,0 with
          smallest value (when represented as a positive integer) such that both
          subgroup orders rd and rd' are prime, and the group order 4 * rd &lt; p, i.e. td &gt; 1. In addition, care must be taken to ensure the MOV degree and CM discriminant requirements from <xref target="security-requirements" /> are met.</t>
          <figure align="center" title="GenerateCurveTEdwards">
            <artwork align="left"><![CDATA[
Input: a prime p = 2^s - c with p = 3 mod 4
Output: the parameter d defining the curve Ed
  1. Set d = 1
  2. while (rd is not prime or rd' is not prime or 4*rd > p) do
       d = d + 1;
     end while
  3. Output d
            ]]></artwork>
          </figure>
        </section>
      </section>
    </section>
    <section anchor="generators" title="Generators">
      <t>The generator points on all six curves are selected as the points of order rb
      and rd, respectively, with the smallest value for x(P) when represented as a
      positive integer.</t>
      <figure align="center" title="GenerateGenWeierstrass">
        <artwork align="left"><![CDATA[
Input: a prime p, and a Weierstrass curve parameter b
Output: a generator point P = (x(P), y(P)) of order rb
1. Set x = 1
2. while ((x^3 - 3 * x + b) is not a quadratic residue modulo p) do
     x = x + 1
   end while
3. Compute an integer s, 0 < s < p, such that 
        s^2 = x^3 - 3 * x + b mod p
4. Set y = min(s, p - s)
5. Output P = (x, y)
        ]]></artwork>
      </figure>
      <figure align="center" title="GenerateGenTEdwards">
        <artwork align="left"><![CDATA[
Input: a prime p and a twisted Edwards curve parameter d
Output: a generator point P = (x(P), y(P)) of order rd
1. Set x = 1
2. while ((d * x^2 = 1 mod p)  
          or ((1 + x^2) * (1 - d * x^2) is not a quadratic residue 
          modulo p)) do x = x + 1
   end while
3. Compute an integer s, 0 < s < p, such that 
        s^2 * (1 - d * x^2) = 1 + x^2 mod p
4. Set y = min(s, p - s)
5. Output P = (x, y)
        ]]></artwork>
      </figure>
    </section>
  </back>
</rfc>
