<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-denhartog-pairing-curves-jose-cose-00" ipr="trust200902">

    <front>
        <title abbrev="draft-denhartog-pairing-curves-jose-cose">Pairing Friendly Curves representations in JOSE and COSE</title>

        <author fullname="Kyle Den Hartog" initials="K." role="editor" surname="Den Hartog">
            <organization>Mattr</organization>
            <address>
                <email>kyle.denhartog@mattr.global</email>
            </address>
        </author>

        <date day="31" month="May" year="2021"/>

        <abstract>
            <t>This specification defines representations enabling the Standards
       for Pairing Frinedly Curves to be used for JSON Object Signing and 
       Encryption (JOSE) and CBOR Object Signing and Encryption (COSE) messages. </t>
        </abstract>
    </front>

    <middle>
        <section anchor="introduction" title="Introduction">
            <t>This specification defines algorithm encodings and representations enabling the Standard Pairing Frinedly Curves to be used for 
   JSON Object Signing and Encryption (JOSE) <xref target="RFC7517">[RFC7517]</xref> and CBOR Object Signing and Encryption (COSE) <xref target="RFC8152">[RFC8152]</xref> messages.  The elliptic curve
    and associated algorithm are registered in appropriate IANA JOSE and COSE registries.</t>

            <section anchor="notational-conventions" title="Notational Conventions">
                <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
        "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
        "OPTIONAL" in this document are to be interpreted as described in BCP 14
                    <xref target="RFC2119">RFC 2119</xref>
                    <xref target="RFC8174">RFC
        8174</xref> when, and only when, they appear in all capitals, as shown
        here.</t>
            </section>
        </section>

        <section anchor="barreto-naehrig-curves" title="Barreto Naehrig (BN) Curves">
            <section anchor="bn256-curve" title="BN256 Curve">
                <section anchor="bn256g1-curve-jose-key-representation" title="Bn256G1 Curve JOSE Key Representation">
                    <t>
The pairing friendly elliptic curve "BN256" which uses the largest prime-order subgroup of E(GF(p))
is represented in a JSON Web Key (JWK) <xref target="RFC7517">[RFC7517]</xref> using these values:
    o  "kty": "OKP"
    o  "crv": "Bn256G1"
plus "x" value to represent the curve point for the public key. The "x" value MUST be encoded using
<xref target="SEC1">[SEC1]</xref> format and MUST be base64url encoded without padding as defined in
<xref target="RFC7515">[RFC7515]</xref> Appendix C.
                    </t>
                </section>
                <section anchor="bn256g1-curve-cose-key-representation" title="Bn256G1 Curve COSE Key Representation">
                    <t>
                    It is represented in a COSE_Key <xref target="RFC8152">[RFC8152]</xref> using these values: <vspace/>
                    </t>
                    <t>
                        o "kty" (1): "OKP" (1)<vspace/>
                        o "crv" (-1): "Bn256G1" (TBD - requested assignment 9)<vspace/>
                    </t>
                    <t>
                    plus "x" (-2) values to represent the curve point for the key. The "x" value MUST be encoded using <xref target="SEC1">[SEC1]</xref> point compression format.
                    </t>
                </section>
                <section anchor="bn256g2-curve-jose-key-representation" title="Bn256G2 Curve JOSE Key Representation">
                    <t>
                    The pairing friendly elliptic curve "BN256" which uses an r-order subgroup of E'(GF(p^2)) is represented in a JSON Web Key (JWK) <xref target="RFC7517">[RFC7517]</xref> using these values:<vspace/>
                    </t>
                    <t>

                            o  "kty": "OKP"<vspace/>
                            o  "crv": "Bn256G2"<vspace/>
                    </t>
                    <t>
                    plus "x" value to represent the curve point for the public key. The "x" value MUST be encoded using <xref target="SEC1">[SEC1]</xref> and MUST be base64url encoded without padding as defined in <xref target="RFC7515">[RFC7515]</xref> Appendix C.
                    </t>
                </section>
                <section anchor="bn256g2-curve-cose-key-representation" title="Bn256G2 Curve COSE Key Representation">
                    <t>
                    It is represented in a COSE_Key <xref target="RFC8152">[RFC8152]</xref> using these values:<vspace/>
                    </t>
                    <t>                    
                        o  "kty" (1): "OKP" (1)<vspace/>
                        o  "crv" (-1): "Bn256G2" (TBD - requested assignment 10)<vspace/>
                    </t>
                    <t>
                    plus "x" (-2) values to represent the curve point for the key. The "x" value MUST be encoded using <xref target="SEC1">[SEC1]</xref> point compression format.
                    </t>
                </section>
            </section>

            <section anchor="bn462-curve" title="BN462 Curve">
                <section anchor="bn462g1-curve-jose-key-representation" title="Bn462G1 Curve JOSE Key Representation">
                    <t>
                    The pairing friendly elliptic curve "BN462" which uses the largest prime-order subgroup of E(GF(p)) is represented in a JSON Web Key (JWK) <xref target="RFC7517">[RFC7517]</xref> using these values:<vspace/>
                    </t>
                    <t>
                        o  "kty": "OKP"<vspace/>
                        o  "crv": "Bn462G1"<vspace/>
                    </t>
                    <t>
                    plus "x" value to represent the curve point for the public key. The "x" value MUST be encoded using <xref target="SEC1">[SEC1]</xref> and MUST be base64url encoded without padding as defined in <xref target="RFC7515">[RFC7515]</xref> Appendix C.
                    </t>
                </section>
                <section anchor="bn462g1-curve-cose-key-representation" title="Bn462G1 Curve COSE Key Representation">
                    <t>
                    It is represented in a COSE_Key <xref target="RFC8152">[RFC8152]</xref> using these values:<vspace/>
                    </t>
                    <t>
                        o  "kty" (1): "OKP" (1)<vspace/>
                        o  "crv" (-1): "Bn462G1" (TBD - requested assignment 11)<vspace/>
                    </t>
                    <t>
                    plus "x" (-2) values to represent the curve point for the key.
                    </t>
                </section>
                <section anchor="bn462g2-curve-jose-key-representation" title="Bn462G2 Curve JOSE Key Representation">
                    <t>
                    The pairing friendly elliptic curve "BN462" which uses an r-order subgroup of E'(GF(p^2)) is represented in a JSON Web Key (JWK) <xref target="RFC7517">[RFC7517]</xref> using these values:<vspace/>
                    </t>
                    <t>
                            o  "kty": "OKP"<vspace/>
                            o  "crv": "Bn462G2"<vspace/>
                    </t>
                    <t>
                    plus "x" value to represent the curve point for the public key. The "x" value MUST be encoded using <xref target="SEC1">[SEC1]</xref> and MUST be base64url encoded without padding as defined in <xref target="RFC7515">[RFC7515]</xref> Appendix C.
                    </t>
                </section>
                <section anchor="bn462g2-curve-cose-key-representation" title="Bn462G2 Curve COSE Key Representation">
                    <t>
                    It is represented in a COSE_Key <xref target="RFC8152">[RFC8152]</xref> using these values:<vspace/>
                    </t>
                    <t>
                        o  "kty" (1): "OKP" (1)<vspace/>
                        o  "crv" (-1): "Bn462G2" (TBD - requested assignment 12)<vspace/>
                    </t>
                    <t>
                    plus "x" (-2) values to represent the curve point for the key.
                    </t>
                </section>
            </section>
        </section>

        <section anchor="barreto-lynn-scott-curves" title="Barreto Lynn Scott (BLS) Curves">
            <section anchor="bls12381-curve" title="BLS12-381 Curve">
                <section anchor="bls12381g1-curve-jose-key-representation" title="Bls12381G1 Curve JOSE Key Representation">
                    <t>
                    The pairing friendly elliptic curve "BLS12-381" which uses the largest prime-order subgroup of E(GF(p)) is represented in a JSON Web Key (JWK) <xref target="RFC7517">[RFC7517]</xref> using these values:<vspace/>
                    </t>
                    <t>
                        o  "kty": "OKP"<vspace/>
                        o  "crv": "Bls12381G1"<vspace/>
                    </t>
                    <t>
                    plus "x" value to represent the curve point for the public key. The "x" value MUST be encoded using the Z-Cash serialization defined in <xref target="DPFC09">[DPFC09]</xref> and MUST be base64url encoded without padding as defined in <xref target="RFC7515">[RFC7515]</xref> Appendix C.
                    </t>
                </section>
                <section anchor="bls12381g1-curve-cose-key-representation" title="Bls12381G1 Curve COSE Key Representation">
                    <t>
                    It is represented in a COSE_Key <xref target="RFC8152">[RFC8152]</xref> using these values:<vspace/>
                    </t>
                    <t>
                        o  "kty" (1): "OKP" (1)<vspace/>
                        o  "crv" (-1): "Bls12381G1" (TBD - requested assignment 13)<vspace/>
                    </t>
                    <t>
                    plus "x" (-2) values to represent the curve point for the key.
                    </t>
                </section>
                <section anchor="bls12381g2-curve-jose-key-representation" title="Bls12381G2 Curve JOSE Key Representation">
                    <t>
                    The pairing friendly elliptic curve "BLS12-381" which uses an r-order subgroup of E'(GF(p^2)) is represented in a JSON Web Key (JWK) <xref target="RFC7517">[RFC7517]</xref> using these values:<vspace/>
                    </t>
                    <t>
                        o  "kty": "OKP"<vspace/>
                        o  "crv": "Bls12381G2"<vspace/>
                    </t>
                    <t>
                    plus "x" value to represent the curve point for the public key. The "x" value MUST be encoded using the Z-Cash serialization defined in <xref target="DPFC09">[DPFC09]</xref> and MUST be base64url encoded without padding as defined in <xref target="RFC7515">[RFC7515]</xref> Appendix C.
                    </t>
                </section>
                <section anchor="bls12381g2-curve-cose-key-representation" title="Bls12381G2 Curve COSE Key Representation">
                    <t>
                    It is represented in a COSE_Key <xref target="RFC8152">[RFC8152]</xref> using these values:<vspace/>
                    </t>
                    <t>
                        o  "kty" (1): "OKP" (1)<vspace/>
                        o  "crv" (-1): "Bls12381G2" (TBD - requested assignment 14)<vspace/>
                    </t>
                    <t>
                    plus "x" (-2) values to represent the curve point for the key.
                    </t>
                </section>
            </section>

            <section anchor="bls48581-curve" title="BLS48-581 Curve">
                <section anchor="bls48581g1-curve-jose-key-representation" title="Bls48581G1 Curve JOSE Key Representation">
                    <t>
                    The pairing friendly elliptic curve "BLS48-581" which uses the largest prime-order subgroup of E(GF(p)) is represented in a JSON Web Key (JWK) <xref target="RFC7517">[RFC7517]</xref> using these values:<vspace/>
                    </t>
                    <t>
                        o  "kty": "OKP"<vspace/>
                        o  "crv": "Bls48581G1"<vspace/>
                    </t>
                    <t>
                    plus "x" value to represent the curve point for the public key. The "x" value MUST be encoded using <xref target="SEC1">[SEC1]</xref> and MUST be base64url encoded without padding as defined in <xref target="RFC7515">[RFC7515]</xref> Appendix C.
                    </t>
                </section>
                <section anchor="bls48581g1-curve-cose-key-representation" title="Bls48581G1 Curve COSE Key Representation">
                    <t>
                    It is represented in a COSE_Key <xref target="RFC8152">[RFC8152]</xref> using these values:<vspace/>
                    </t>
                    <t>
                        o  "kty" (1): "OKP" (1)<vspace/>
                        o  "crv" (-1): "Bls48581G1" (TBD - requested assignment 15)<vspace/>
                    </t>
                    <t>
                    plus "x" (-2) values to represent the curve point for the key.
                    </t>
                </section>
                <section anchor="bls48581g2-curve-jose-key-representation" title="Bls48581G2 Curve JOSE Key Representation">
                    <t>
                    The pairing friendly elliptic curve "BLS48-581" which uses the largest prime-order subgroup of E'(GF(p^8)) is represented in a JSON Web Key (JWK) <xref target="RFC7517">[RFC7517]</xref> using these values:<vspace/>
                    </t>
                    <t>
                        o  "kty": "OKP"<vspace/>
                        o  "crv": "Bls48581G2"<vspace/>
                    </t>
                    <t>
                    plus "x" value to represent the curve point for the public key. The "x" value MUST be encoded using <xref target="SEC1">[SEC1]</xref> and MUST be base64url encoded without padding as defined in <xref target="RFC7515">[RFC7515]</xref> Appendix C.
                    </t>
                </section>
                <section anchor="bls48581g2-curve-cose-key-representation" title="Bls48581G2 Curve COSE Key Representation">
                    <t>
                    It is represented in a COSE_Key <xref target="RFC8152">[RFC8152]</xref> using these values:<vspace/>
                    </t>
                    <t>
                        o  "kty" (1): "OKP" (1)<vspace/>
                        o  "crv" (-1): "Bls48581G1" (TBD - requested assignment 16)<vspace/>
                    </t>
                    <t>
                    plus "x" (-2) values to represent the curve point for the key.
                    </t>
                </section>
            </section>
        </section>

        <section anchor="iana-considerations" title="IANA Considerations">
            <section anchor="json-web-key-ec-registration" title="JSON Web Key Elliptic Curve Registrations">
                <t>
                This section registers the following value in the IANA "JSON Web Key
                Elliptic Curve" registry [IANA.JOSE.Curves].
                </t>

                <t>
                o  Curve Name: Bn256G1<vspace/>
                o  Curve Description: 256 bit Barreto-Naehrig pairing friendly curve using the largest prime-order subgroup of E(GF(p))<vspace/>
                o  JOSE Implementation Requirements: Prohibited<vspace/>
                o  Change Controller: IESG<vspace/>
                o  Specification Document(s): Section 2.1 of [[ this specification ]]<vspace/>
                </t>

                <t>
                o  Curve Name: Bn256G2<vspace/>
                o  Curve Description: 256 bit Barreto-Naehrig pairing friendly curve using an r-order subgroup of E'(GF(p^2))<vspace/>
                o  JOSE Implementation Requirements: Prohibited<vspace/>
                o  Change Controller: IESG<vspace/>
                o  Specification Document(s): Section 2.3 of [[ this specification ]]<vspace/>
                </t>

                <t>
                o  Curve Name: Bn462G1<vspace/>
                o  Curve Description: 462 bit Barreto-Naehrig pairing friendly curve using the largest prime-order subgroup of E(GF(p))<vspace/>
                o  JOSE Implementation Requirements: Optional<vspace/>
                o  Change Controller: IESG<vspace/>
                o  Specification Document(s): Section 2.5 of [[ this specification ]]<vspace/>
                </t>

                <t>
                o  Curve Name: Bn462G2<vspace/>
                o  Curve Description: 462 bit Barreto-Naehrig pairing friendly curve using an r-order subgroup of E'(GF(p^2))<vspace/>
                o  JOSE Implementation Requirements: Optional<vspace/>
                o  Change Controller: IESG<vspace/>
                o  Specification Document(s): Section 2.7 of [[ this specification ]]<vspace/>
                </t>

                <t>
                o  Curve Name: Bls12381G1<vspace/>
                o  Curve Description: 381 bit with an embedding degree of 12 Barreto-Lynn-Scott pairing friendly curve using an r-order subgroup of E(GF(p))<vspace/>
                o  JOSE Implementation Requirements: Optional<vspace/>
                o  Change Controller: IESG<vspace/>
                o  Specification Document(s): Section 3.1 of [[ this specification ]]<vspace/>
                </t>

                <t>
                o  Curve Name: Bls12381G2<vspace/>
                o  Curve Description: 381 bit with an embedding degree of 12 Barreto-Lynn-Scott pairing friendly curve using an r-order subgroup of E'(GF(p^2))<vspace/>
                o  JOSE Implementation Requirements: Optional<vspace/>
                o  Change Controller: IESG<vspace/>
                o  Specification Document(s): Section 3.3 of [[ this specification ]]<vspace/>
                </t>

                <t>
                o  Curve Name: Bls48581G1<vspace/>
                o  Curve Description: 581 bit with an embedding degree of 48 Barreto-Lynn-Scott pairing friendly curve using an r-order subgroup of E(GF(p))<vspace/>
                o  JOSE Implementation Requirements: Optional<vspace/>
                o  Change Controller: IESG<vspace/>
                o  Specification Document(s): Section 3.5 of [[ this specification ]]<vspace/>
                </t>

                <t>
                o  Curve Name: Bls48581G1<vspace/>
                o  Curve Description: 581 bit with an embedding degree of 48 Barreto-Lynn-Scott pairing friendly curve using an r-order subgroup of E'(GF(p^8))<vspace/>
                o  JOSE Implementation Requirements: Optional<vspace/>
                o  Change Controller: IESG<vspace/>
                o  Specification Document(s): Section 3.7 of [[ this specification ]]<vspace/>
                </t>
            </section>

            <section anchor="cbor-web-key-ec-registration" title="COSE Elliptic Curve Registrations">
                <t>
                This section registers the following value in the IANA "JSON Web Key
                Elliptic Curve" registry [IANA.JOSE.Curves].
                </t>

                <t>
                o  Curve Name: Bn256G1<vspace/>
                o  Value: TBD (requested assignment 9)<vspace/>
                o  Key Type: OKP<vspace/>
                o  Curve Description: 256 bit Barreto-Naehrig pairing friendly curve using the largest prime-order subgroup of E(GF(p))<vspace/>
                o  JOSE Implementation Requirements: Prohibited<vspace/>
                o  Change Controller: IESG<vspace/>
                o  Specification Document(s): Section 2.2 of [[ this specification ]]<vspace/>
                o  Recommended: No (Prohibited)<vspace/>

                </t>

                <t>
                o  Curve Name: Bn256G2<vspace/>
                o  Value: TBD (requested assignment 10)<vspace/>
                o  Key Type: OKP<vspace/>
                o  Curve Description: 256 bit Barreto-Naehrig pairing friendly curve using an r-order subgroup of E'(GF(p^2))<vspace/>
                o  JOSE Implementation Requirements: Prohibited<vspace/>
                o  Change Controller: IESG<vspace/>
                o  Specification Document(s): Section 2.4 of [[ this specification ]]<vspace/>
                o  Recommended: No (Prohibited)<vspace/>
                </t>

                <t>
                o  Curve Name: Bn462G1<vspace/>
                o  Value: TBD (requested assignment 11)<vspace/>
                o  Key Type: OKP<vspace/>
                o  Curve Description: 462 bit Barreto-Naehrig pairing friendly curve using the largest prime-order subgroup of E(GF(p))<vspace/>
                o  JOSE Implementation Requirements: Optional<vspace/>
                o  Change Controller: IESG<vspace/>
                o  Specification Document(s): Section 2.6 of [[ this specification ]]<vspace/>
                o  Recommended: No<vspace/>
                </t>

                <t>
                o  Curve Name: Bn462G2<vspace/>
                o  Value: TBD (requested assignment 12)<vspace/>
                o  Key Type: OKP<vspace/>
                o  Curve Description: 462 bit Barreto-Naehrig pairing friendly curve using an r-order subgroup of E'(GF(p^2))<vspace/>
                o  JOSE Implementation Requirements: Optional<vspace/>
                o  Change Controller: IESG<vspace/>
                o  Specification Document(s): Section 2.8 of [[ this specification ]]<vspace/>
                o  Recommended: No<vspace/>
                </t>

                <t>
                o  Curve Name: Bls12381G1<vspace/>
                o  Value: TBD (requested assignment 13)<vspace/>
                o  Key Type: OKP<vspace/>
                o  Curve Description: 381 bit with an embedding degree of 12 Barreto-Lynn-Scott pairing friendly curve using an r-order subgroup of E(GF(p))<vspace/>
                o  JOSE Implementation Requirements: Optional<vspace/>
                o  Change Controller: IESG<vspace/>
                o  Specification Document(s): Section 3.2 of [[ this specification ]]<vspace/>
                o  Recommended: Yes<vspace/>
                </t>

                <t>
                o  Curve Name: Bls12381G2<vspace/>
                o  Value: TBD (requested assignment 14)<vspace/>
                o  Key Type: OKP<vspace/>
                o  Curve Description: 381 bit with an embedding degree of 12 Barreto-Lynn-Scott pairing friendly curve using an r-order subgroup of E'(GF(p^2))<vspace/>
                o  JOSE Implementation Requirements: Optional<vspace/>
                o  Change Controller: IESG<vspace/>
                o  Specification Document(s): Section 3.4 of [[ this specification ]]<vspace/>
                o  Recommended: Yes<vspace/>
                </t>

                <t>
                o  Curve Name: Bls48581G1<vspace/>
                o  Value: TBD (requested assignment 15)<vspace/>
                o  Key Type: OKP<vspace/>
                o  Curve Description: 581 bit with an embedding degree of 48 Barreto-Lynn-Scott pairing friendly curve using an r-order subgroup of E(GF(p))<vspace/>
                o  JOSE Implementation Requirements: Optional<vspace/>
                o  Change Controller: IESG<vspace/>
                o  Specification Document(s): Section 3.6 of [[ this specification ]]<vspace/>
                o  Recommended: No<vspace/>
                </t>

                <t>
                o  Curve Name: Bls48581G1<vspace/>
                o  Value: TBD (requested assignment 16)<vspace/>
                o  Key Type: OKP<vspace/>
                o  Curve Description: 581 bit with an embedding degree of 48 Barreto-Lynn-Scott pairing friendly curve using an r-order subgroup of E'(GF(p^8))<vspace/>
                o  JOSE Implementation Requirements: Optional<vspace/>
                o  Change Controller: IESG<vspace/>
                o  Specification Document(s): Section 3.8 of [[ this specification ]]<vspace/>
                o  Recommended: No<vspace/>
                </t>
            </section>
        </section>

        <section anchor="security-considerations" title="Security Considerations">
            <t>See <xref target="DPFC09">[DPFC09]</xref> for additional details about security considerations of the curves used. Implementers should also consider section 9 of 
                <xref target="RFC7517">[RFC7517]</xref> when implementing this work.</t>
        </section>

        <section anchor="privacy-considerations" title="Privacy Considerations">
            <t>To be added.</t>
        </section>

        <section anchor="acknowledgements" title="Acknowledgements">
            <t>The authors of this draft would like to acknowledge the 
    following individuals for the significant contribution of ideas and 
    time spent reviewing this document:
            </t>
        </section>
    </middle>

    <back>
        <references title='Normative References'>
            <?rfc include='reference.RFC.2119.xml'?>
            <?rfc include='reference.RFC.7515.xml'?>
            <?rfc include='reference.RFC.7517.xml'?>
            <?rfc include='reference.RFC.8152.xml'?>
            <?rfc include='reference.RFC.8174.xml'?>
            <reference anchor="DPFC09" target="https://tools.ietf.org/html/draft-irtf-cfrg-pairing-friendly-curves-09">
                <front>
                    <title>Pairing-Friendly Curves</title>
                    <author>
                        <organization>IRTF CFRG</organization>
                    </author>
                    <date month="November" year="2020"/>
                </front>
            </reference>
            <reference anchor="SEC1" target="https://www.secg.org/sec1-v2.pdf">
                <front>
                    <title>SEC 1: Elliptic Curve Cryptography</title>
                    <author >
                        <organization>Standards for Efficient Cryptography Group (SECG)</organization>
                    </author>
                    <date year="2009"/>
                </front>
            </reference>
        </references>
    </back>
</rfc>

