Re: [COSE] "P-256K" in draft-ietf-cose-webauthn-algorithms

Mike Jones <Michael.Jones@microsoft.com> Fri, 05 April 2019 18:49 UTC

Return-Path: <Michael.Jones@microsoft.com>
X-Original-To: cose@ietfa.amsl.com
Delivered-To: cose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 22CFD12000F for <cose@ietfa.amsl.com>; Fri, 5 Apr 2019 11:49:47 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=microsoft.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GsCDTul9-PhF for <cose@ietfa.amsl.com>; Fri, 5 Apr 2019 11:49:43 -0700 (PDT)
Received: from NAM06-BL2-obe.outbound.protection.outlook.com (mail-eopbgr650100.outbound.protection.outlook.com [40.107.65.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3E64512008D for <cose@ietf.org>; Fri, 5 Apr 2019 11:49:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g9QGKVnyeZVL1J7+/QBmV559d/4pIa5pyA798BqMCig=; b=bbnBi7f7Omqep0vKyNK5UkR9z6EAlRqyTvuqYqAAx5YIkEjlJvbCCI3DQEx7pQiqB0hTtWGwzb8dbcyMqb/6GIAc3j8f7pae4UISizcNXc7lccz8ipkeYNcOI4Wr3nDuu3UXkboKOaR9QacThykOotApBZUNq+HLew7ol2BJ4vw=
Received: from SN6PR00MB0304.namprd00.prod.outlook.com (52.132.117.158) by SN6PR00MB0415.namprd00.prod.outlook.com (52.132.118.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1817.0; Fri, 5 Apr 2019 18:49:39 +0000
Received: from SN6PR00MB0304.namprd00.prod.outlook.com ([fe80::d017:ba79:6e59:70b]) by SN6PR00MB0304.namprd00.prod.outlook.com ([fe80::d017:ba79:6e59:70b%3]) with mapi id 15.20.1813.000; Fri, 5 Apr 2019 18:49:39 +0000
From: Mike Jones <Michael.Jones@microsoft.com>
To: John Mattsson <john.mattsson@ericsson.com>, Filip Skokan <panva.ip@gmail.com>, "cose@ietf.org" <cose@ietf.org>
Thread-Topic: [COSE] "P-256K" in draft-ietf-cose-webauthn-algorithms
Thread-Index: AQHU5J9bsQ8/O+HBUkWOsDZ9qRHT/6YscJGQgADfCgCAAKbv4A==
Date: Fri, 05 Apr 2019 18:49:39 +0000
Message-ID: <SN6PR00MB030435272BC31431D76122A2F5510@SN6PR00MB0304.namprd00.prod.outlook.com>
References: <64A280DE-04BF-4443-8ED5-EFF25E38E4C2@gmail.com> <SN6PR00MB0304FF17D8F88C687D3E2075F5500@SN6PR00MB0304.namprd00.prod.outlook.com> <F18E55B6-6336-47CC-AA5A-32C6197657D3@ericsson.com>
In-Reply-To: <F18E55B6-6336-47CC-AA5A-32C6197657D3@ericsson.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=330f0c3a-8a9d-4790-87f2-0000e45053fe; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2019-04-05T18:46:35-0800; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;
authentication-results: spf=none (sender IP is ) smtp.mailfrom=Michael.Jones@microsoft.com;
x-originating-ip: [2001:4898:80e8:8:f8e7:fefd:4332:7dfc]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 0d49499b-9c29-4e3a-84d3-08d6b9f77562
x-ms-office365-filtering-ht: Tenant
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:SN6PR00MB0415;
x-ms-traffictypediagnostic: SN6PR00MB0415:
x-ms-exchange-purlcount: 5
x-microsoft-antispam-prvs: <SN6PR00MB041569A935351F6A50425BEDF5510@SN6PR00MB0415.namprd00.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:9508;
x-forefront-prvs: 0998671D02
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(376002)(346002)(136003)(39860400002)(396003)(51914003)(52314003)(199004)(189003)(110136005)(6436002)(8936002)(8676002)(186003)(446003)(81156014)(81166006)(11346002)(76176011)(606006)(966005)(14454004)(25786009)(74316002)(7736002)(256004)(476003)(486006)(229853002)(22452003)(316002)(21615005)(53546011)(33656002)(6506007)(99286004)(7696005)(71190400001)(102836004)(71200400001)(236005)(97736004)(105586002)(53936002)(106356001)(10290500003)(10090500001)(6246003)(86362001)(9686003)(54896002)(6306002)(66574012)(55016002)(2501003)(5660300002)(52536014)(86612001)(46003)(478600001)(72206003)(6116002)(790700001)(8990500004)(2906002)(68736007); DIR:OUT; SFP:1102; SCL:1; SRVR:SN6PR00MB0415; H:SN6PR00MB0304.namprd00.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1;
received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam-message-info: wfq8vN0/nHSpRa2QLk0IfRFSBZwfXzW7y3Xk7UARaxLON0576DJ/TS9QAc9rZJwO5NWAAuMjZCem8UiN0UMvpDCIEJxcRLRZfUpvaRYh30WcPLgH2b4xXHOnKCtwOjgWVacf+33G55LfrI1o8scINW5d5PS5TWk2phSO9GLOeLp/PLmboMmFk3Tl2ZBnOvj/vu8Hg/dB5/NHrWNy509zQ6VsyA9s2zw0s4bn5MdEjqbsRwo1FXj5DWIY6Jb3azFy5dtWIymhFbF1U0R5XpUV7neL5B1aBE24iPf/v7BXMARgQP7G8DsPQqbJUo/hb2SwHeytpTHcHGvkPvheVkqSohAkD1DvkrxonFaJGUUtgVqRgXETMoTWMicYL2Pom/cmt+f1D8P+usF4GUVwE6Vn6+9apbtMNguFNw86uqOo+s4=
Content-Type: multipart/alternative; boundary="_000_SN6PR00MB030435272BC31431D76122A2F5510SN6PR00MB0304namp_"
MIME-Version: 1.0
X-OriginatorOrg: microsoft.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0d49499b-9c29-4e3a-84d3-08d6b9f77562
X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Apr 2019 18:49:39.6115 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR00MB0415
Archived-At: <https://mailarchive.ietf.org/arch/msg/cose/zAw07PqK_iRk1AhJZzjlYFO2L2A>
Subject: Re: [COSE] "P-256K" in draft-ietf-cose-webauthn-algorithms
X-BeenThere: cose@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: CBOR Object Signing and Encryption <cose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cose>, <mailto:cose-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cose/>
List-Post: <mailto:cose@ietf.org>
List-Help: <mailto:cose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cose>, <mailto:cose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 05 Apr 2019 18:49:47 -0000

Thanks for the super-useful context, John.  Given that this isn’t a NIST curve, it seems that the “P-” naming is misleading and it’s unhelpful to introduce another name for the same thing.  I therefore plan to change the JOSE curve name to “secp256k1” in the next draft.  Yes, early implementations will need to change, but I suspect that we’d have to do this during IETF or IESG review anyway, so probably the earlier we make the change, the better.

                                                                -- Mike

From: COSE <cose-bounces@ietf.org> On Behalf Of John Mattsson
Sent: Friday, April 5, 2019 1:49 AM
To: Mike Jones <Michael.Jones=40microsoft.com@dmarc.ietf.org>; Filip Skokan <panva.ip@gmail.com>; cose@ietf.org
Subject: Re: [COSE] "P-256K" in draft-ietf-cose-webauthn-algorithms

Hi,

Googling gives the following results:

"P-256K"             About 1 010 results   (where most hits are about 256K or memory)
"secp256k1"      About 97 700 results

I dislike "P-256K" in any IETF specification (JOSE, COSE, etc.) for two reasons:

1. The situation with 3 different SDOs giving different names to the same curves as summarized in Appendix A of RFC 8442 is bad enough. IETF does not need to make the situation worse by assigning a new name to secp256k1. Three columns in the table is more than enough.

2. If IETF need to assign a new name to secp256k1 I think "P-256K" is a bad choice as it gives the impression that it is a curve standardized by NIST (which it is not). I have already heard knowledgeable people thinking that it is a NIST curve. Given the recent IETF fury about ITU naming a protocol eTLS, I think IETF should refrain from this unless we get ok from NIST.

I have no objections to the curve itself or the name ES256K.

>what is the meaning of the “P” in the identifiers for the NIST curves “P-256”, etc.?

The P in NIST curves (P-256, P-384, etc.) means Prime
The K in NIST curves (K-233, K-283, etc.) means Koblitz
The B in NIST curves (B-233, B-283, etc.) means Binary

The r in SECG curves (secp256r1, secp384r1) means random
The k in SECG curves (secp256k1, sect233k1) means koblitz
The p in SECG curves (secp256r1, secp256k1) means prime
The t in SECG curves (sect233r1, sect233k1) means two?

John

From: COSE <cose-bounces@ietf.org<mailto:cose-bounces@ietf.org>> on behalf of Mike Jones <Michael.Jones=40microsoft.com@dmarc.ietf.org<mailto:Michael.Jones=40microsoft.com@dmarc.ietf.org>>
Date: Thursday, 4 April 2019 at 21:37
To: Filip Skokan <panva.ip@gmail.com<mailto:panva.ip@gmail.com>>, "cose@ietf.org<mailto:cose@ietf.org>" <cose@ietf.org<mailto:cose@ietf.org>>
Subject: Re: [COSE] "P-256K" in draft-ietf-cose-webauthn-algorithms

More voices on the subject of what JOSE curve identifier should be used would be useful, as I want to publish an updated draft addressing review comments received to date.  To date, the input I’ve received is:

·         For “P-256K”:  Filip Skokan and Vladimir Dzhuvinov (off list)

·         For “secp256k1”:  Jim Schaad and John Mattsson

What do others think?

Also, as it might aid in thinking about the choices, what is the meaning of the “P” in the identifiers for the NIST curves “P-256”, etc.?

                                                       Thanks,
                                                       -- Mike

From: COSE <cose-bounces@ietf.org<mailto:cose-bounces@ietf.org>> On Behalf Of Filip Skokan
Sent: Wednesday, March 27, 2019 6:17 AM
To: cose@ietf.org<mailto:cose@ietf.org>
Subject: [COSE] "P-256K" in draft-ietf-cose-webauthn-algorithms

Hello,

Once more to the correct mailing list...

this draft has caught my attention since it touches JOSE as well, specifically it proposes registration for the uses of secp256k1 "bitcoin" curve. I learned from Mike Jones that there's a discussion around naming the key's curve and the JWA algorithm.

- "P-256K"
Do we really need a new name for secp256k1? I would suggest not. Most of the document talks about secp256k1 anyway. Giving secp256k1 the alias P-256K gives the impression that it is a curve standardized by NIST, which it is not. Mike> Others have also suggested simply using the name "secp256k1". I'm fine with that.

I'd like to advocate for sticking with the proposed (in current draft) "P-256K" for EC key's crv, and "ES256K" for the JWA alg. These values are already quite common in existing implementations, quite a few hits for this.

[1] https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.keyvault.eckey.p256k?view=azure-dotnet
[2] https://connect2id.com/products/nimbus-jose-jwt/examples/jwt-with-es256k-signature
[3] https://static.javadoc.io/com.nimbusds/nimbus-jose-jwt/5.10/com/nimbusds/jose/jwk/ECKey.html
[4] https://github.com/panva/jose/blob/master/lib/jwk/key/ec.js#L22-L23
[5] https://github.com/relocately/ec-key

As mentioned in the IETF 104 meeting on Tuesday the other encountered naming of this is "K-256" but there's considerably less hits searching for implementations using that one.

I understand the COSE group does not (probably) have existing implementations of secp256k1 and that's why the notion of just naming it secp256k1 resonates, but maybe consider only doing so for COSE. JOSE could use less fragmentation amongst its implementations and therefore sticking to the most common naming already in the wild would be welcome.

The same applies to the presented question about Compressed vs. Non-compressed Points for secp256k1, i'd advocate that at least for JOSE the used points remain in-line with what's already used in with the existing keys and algorithms.

Best,
Filip Skokan