Re: [TLS] [Cfrg] Closing out tls1.3 "Limits on key usage" PRs (#765/#769).

Andrey Jivsov <> Fri, 03 March 2017 02:33 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 2D0B0129460 for <>; Thu, 2 Mar 2017 18:33:03 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.6
X-Spam-Status: No, score=-2.6 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id RSu1C3fs_n4s for <>; Thu, 2 Mar 2017 18:33:01 -0800 (PST)
Received: from ( [IPv6:2001:558:fe16:19:96:114:154:162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 84F87129477 for <>; Thu, 2 Mar 2017 18:33:01 -0800 (PST)
Received: from ([]) by with SMTP id jd0tcbXfXyXuHjd1gc5PG9; Fri, 03 Mar 2017 02:33:00 +0000
Received: from [IPv6:::1] ([]) by with SMTP id jd1fcqYwG8jz5jd1gc1zIs; Fri, 03 Mar 2017 02:33:00 +0000
To: Hal Murray <>
References: <>
From: Andrey Jivsov <>
Message-ID: <>
Date: Thu, 2 Mar 2017 18:32:59 -0800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0
MIME-Version: 1.0
In-Reply-To: <>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 8bit
X-CMAE-Envelope: MS4wfH3tVOs1W5JO6eUaHvUYL+A87IgD3LIENcTPlu4GC2Oum77KKCkQphZCelAjc94Jmek9toovK9KI3Rc0C8jv5qClqrLDOipcVgv8a9HfUDC4I3hzDfFN vG5l3cpEPg45bPODvNN077c9eI7DTmW59orWygaA1dXLO+N487YUkx2tZn0DRoQ0rRIZsFeYrY7exkx5r42JJU5clD2tDFvoqSs=
Archived-At: <>
Subject: Re: [TLS] [Cfrg] Closing out tls1.3 "Limits on key usage" PRs (#765/#769).
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Fri, 03 Mar 2017 02:33:03 -0000

On 03/02/2017 05:54 PM, Hal Murray wrote:
> said:
>> I also think that counting in blocks is cleaner. Counting in bytes is a
>> close alternative. 
> Does counting bytes work?  If the real limit is blocks, I think you will have 
> to round up the byte count when you send a partial block.
> If re-keying too often isn't too expensive, you could get a safe answer by 
> counting bytes and assuming that every byte went in a separate block.
> You might want to round down many more orders of magnitude so the re-key code 
> gets exercised often enough.  Or maybe provide a back door to set the limit 
> so that path can be tested with reasonable resources.

I like the idea of setting the rekey limits, so that the code can be
tested. There is no 3DES in TLS 1.3.

You refer to some under-counting.

The worst case is mod 16 = 1 byte sized TLS records, in which case the
"tails" will only be counted as 1 block per 16 TLS records v.s. desired
16. We are undercounting less than one 16-byte block per record.

One can count in record_size_in_bytes + 16 as one solution (overcount).

However, is it true that 1-byte terminal blocks must be counted as full
16-byte blocks? 1-byte blocks don't seem to directly apply to the proofs
with distinguishing game. With 1-byte plaintext / ciphertext we are not
making statements about two values from the 1^128 members space. Rather,
we are discussing two values from the tiny 256 members space. Also, a
truncated AES-GCM encryption behaves as PRF and not PRP.