Re: [TLS] Before we PQC... Re: PQC key exchange sizes

Ilari Liusvaara <ilariliusvaara@welho.com> Sat, 06 August 2022 10:05 UTC

Return-Path: <ilariliusvaara@welho.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5480CC1594AF for <tls@ietfa.amsl.com>; Sat, 6 Aug 2022 03:05:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.909
X-Spam-Level:
X-Spam-Status: No, score=-1.909 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TUAYxVXSYkZJ for <tls@ietfa.amsl.com>; Sat, 6 Aug 2022 03:04:59 -0700 (PDT)
Received: from welho-filter3.welho.com (welho-filter3b.welho.com [83.102.41.29]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CFD92C14F727 for <tls@ietf.org>; Sat, 6 Aug 2022 03:04:57 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by welho-filter3.welho.com (Postfix) with ESMTP id 02C4C15AF7 for <tls@ietf.org>; Sat, 6 Aug 2022 13:04:54 +0300 (EEST)
X-Virus-Scanned: Debian amavisd-new at pp.htv.fi
Received: from welho-smtp1.welho.com ([IPv6:::ffff:83.102.41.84]) by localhost (welho-filter3.welho.com [::ffff:83.102.41.25]) (amavisd-new, port 10024) with ESMTP id 1hRhric4f-3x for <tls@ietf.org>; Sat, 6 Aug 2022 13:04:53 +0300 (EEST)
Received: from LK-Perkele-VII2 (87-92-216-160.rev.dnainternet.fi [87.92.216.160]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by welho-smtp1.welho.com (Postfix) with ESMTPSA id B930028B for <tls@ietf.org>; Sat, 6 Aug 2022 13:04:52 +0300 (EEST)
Date: Sat, 06 Aug 2022 13:04:52 +0300
From: Ilari Liusvaara <ilariliusvaara@welho.com>
To: "<tls@ietf.org>" <tls@ietf.org>
Message-ID: <Yu48xFYESWQ16s7X@LK-Perkele-VII2.locald>
References: <CABzBS7nsbEhR-bmHG_ViSJFSH-0_5p0O3vKndS4+wFR=iGQzhw@mail.gmail.com> <CAMm+LwgAzb4t=awzpU4Sb5j7Bf6DuR3u+23n+h_C3Pnsin-SHg@mail.gmail.com> <CH0PR11MB544479BFF3107C532AD75172C1619@CH0PR11MB5444.namprd11.prod.outlook.com> <20220806051105.GP3579@akamai.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20220806051105.GP3579@akamai.com>
Sender: ilariliusvaara@welho.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/VNIFkJETXBEAmX93Ssc0VdqOkKI>
Subject: Re: [TLS] Before we PQC... Re: PQC key exchange sizes
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tls/>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 06 Aug 2022 10:05:01 -0000

On Fri, Aug 05, 2022 at 10:11:05PM -0700, Benjamin Kaduk wrote:
> Hi Scott,
> 
> On Sat, Aug 06, 2022 at 03:18:31AM +0000, Scott Fluhrer (sfluhrer) wrote:
> > 
> > I’m trying to figure out what you’re saying; at least one of us is
> > confused.  NIST asked for a Key Exchange Mechanism (KEM), and Kyber
> > meets that definition (which is essentially what you describe; both
> > sides gets a shared secret).  That is the functionality that TLS
> > needs, and is the functionality that NIST (and others) evaluated. 
> > Yes, there are internal functions within Kyber; no one is suggesting
> > those be used directly.  And, yes, NIST might tweak the precise
> > definition of Kyber before it is formally approved; any such tweak
> > would be minor (and there might not be any at all); if they do make
> > such a change, it should not be difficult to modify any draft we put
> > out to account for that change.

My guess about the changes is replacing the four different SHA-3
variants (yup, KYBER uses all of SHA3-256, SHA3-512, SHAKE-128 and
SHAKE-256) with some kind of contextualized SHAKE-256. But That's deep
internals of KYBER, not something TLS WG needs to be concerned about.


> I thought KEM expanded to "Key Encapsulation Mechanism" (viz RFC
> 9180). Indeed, my understanding is that PHB's specific point is
> that it is *not* an exchange, and rather that the sender picks a key
> and the recipient just gets that key without contributing do it.
> (Well, I think there is maybe also some bit in PHB's note that's
> quibbling about how the sender doesn't actually pick the key, and
> rather the local output of the KEM is the encapsulated blob plus the
> shared key, with the shared key not being an input to the KEM ...
> but I haven't read NIST's report yet and can't confirm or reject that
> assertion.)  I am reading PHB as saying that the "internal function"
> within Kyber that is an "actual KEM" is one that takes the shared
> key as input and produces the encapsulated blob as output (again,
> cannot confirm or reject).

Due to how KYBER internally works, the public key does contribute to
the final key (e.g., see page 10 of KYBER specification version 3.02).
This leads to both sides contributing to the key if public keys are
not reused (as is recommended). However, I don't think that that
generically holds for IND-CCA2 KEMs.


> > It was my understanding that TLS 1.3 didn’t do rekeys
> > (ChangeCipherSuite).  Instead, the key agreement is done only at
> > connection establishment time, and could be broken into:
> > 
> >   *   Full negotiation (the client not having any context)
> >   *   Resumption (0-RTT or 1-RTT) negotiation (where the client has
> >       some secret data from a previous full negotiation)
> > Because those are both fresh negotiations, I don’t see any
> > alternative to using a postquantum key exchange for both.
> 
> There's also KeyUpdate.
> And the PSK handshake mode that's just psk_ke, not psk_dhe_ke.
> But I don't think I understand PHB's proposed taxonomy yet, either.

I think the point was that even if PQC key material is just indirectly
chained, the thing is still PQC. Of course, only relying on indirect
chaning is not a great idea.

As for TLS 1.3, there is little problem doing direct PQC for both,
because psk_dhe_ke resumption is possible, and (hybrid) PQC KEMs look
like DH to TLS 1.3.



-Ilari