Re: [tcpm] Question on crypto algo usage for TCP-AO

Joseph Touch <touch@strayalpha.com> Wed, 04 August 2021 03:19 UTC

Return-Path: <touch@strayalpha.com>
X-Original-To: tcpm@ietfa.amsl.com
Delivered-To: tcpm@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D5B323A3F43 for <tcpm@ietfa.amsl.com>; Tue, 3 Aug 2021 20:19:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.318
X-Spam-Level:
X-Spam-Status: No, score=-1.318 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=strayalpha.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 qz5V7dOQvWMF for <tcpm@ietfa.amsl.com>; Tue, 3 Aug 2021 20:18:58 -0700 (PDT)
Received: from server217-4.web-hosting.com (server217-4.web-hosting.com [198.54.116.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D889B3A3F39 for <tcpm@ietf.org>; Tue, 3 Aug 2021 20:18:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=strayalpha.com; s=default; h=To:References:Message-Id:Cc:Date:In-Reply-To: From:Subject:Mime-Version:Content-Type:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=KQJIaMzGRvYUQ7QnrdqVmACtjKgedrF4OxVQ6URQu/Y=; b=c5rmXjJnGMYZfqFsUz2qymJDif rYLBWznCnd9XZTwAmxQm9P0hFxeysYgLKb9vRhhdnQsGoCAusv8c7l6jh0LjryUvO3ttOv6pDYfMn DbMKsPT4zGI17VdP784DM8iyDBjmsG6ZhhseMCjY84fHue5CW9Tj5WZCSMjnhjnS4T4QSdskjjCS1 yo/goUMXCL4CkM1zYpo/ws2Aj8YOcOmczWmDNUBMgMIRgADQMIf0rWCtd8XQ92DLwsPTw2fweDF/5 Nk5VjXp1oH2JA0ppxswJAJJa8T6KKOX3vZXqTiaf6ydsSk6C/IDOLzQ+0h4Sj8AgzVRLS1b0iWpP6 E6HbaJlw==;
Received: from cpe-172-114-237-88.socal.res.rr.com ([172.114.237.88]:54338 helo=smtpclient.apple) by server217.web-hosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <touch@strayalpha.com>) id 1mB7Qj-001qIl-Eg; Tue, 03 Aug 2021 23:18:58 -0400
Content-Type: multipart/alternative; boundary="Apple-Mail=_3840A6AD-71BA-4128-A80E-504B238846A9"
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\))
From: Joseph Touch <touch@strayalpha.com>
In-Reply-To: <CAKz0y8x2NWLE1Nzmah5iwvbFRCh3YrMpGU6seudJZMWCJeOE2Q@mail.gmail.com>
Date: Tue, 03 Aug 2021 20:18:52 -0700
Cc: "tcpm@ietf.org Extensions" <tcpm@ietf.org>
Message-Id: <E34B0D3E-8574-480C-B1B6-A5B33B1808D8@strayalpha.com>
References: <CAKz0y8x2NWLE1Nzmah5iwvbFRCh3YrMpGU6seudJZMWCJeOE2Q@mail.gmail.com>
To: Muthu Arul Mozhi Perumal <muthu.arul@gmail.com>
X-Mailer: Apple Mail (2.3654.120.0.1.13)
X-OutGoing-Spam-Status: No, score=-1.0
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - server217.web-hosting.com
X-AntiAbuse: Original Domain - ietf.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - strayalpha.com
X-Get-Message-Sender-Via: server217.web-hosting.com: authenticated_id: touch@strayalpha.com
X-Authenticated-Sender: server217.web-hosting.com: touch@strayalpha.com
X-Source:
X-Source-Args:
X-Source-Dir:
X-From-Rewrite: unmodified, already matched
Archived-At: <https://mailarchive.ietf.org/arch/msg/tcpm/XIOox7s3Ta5yEL8ftgpGY7jj8KM>
Subject: Re: [tcpm] Question on crypto algo usage for TCP-AO
X-BeenThere: tcpm@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: TCP Maintenance and Minor Extensions Working Group <tcpm.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tcpm>, <mailto:tcpm-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tcpm/>
List-Post: <mailto:tcpm@ietf.org>
List-Help: <mailto:tcpm-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tcpm>, <mailto:tcpm-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 04 Aug 2021 03:19:03 -0000

Hi all,

I would post this to the security area WG for better feedback, given it’s only transport in its use by TCP.

My view is that this is not particularly unambiguous, as noted below.

Joe

> On Aug 2, 2021, at 6:06 AM, Muthu Arul Mozhi Perumal <muthu.arul@gmail.com> wrote:
> 
> Hi,
> 
> Section 3.1.1 of RFC 5926 describes how to derive the traffic key of desired length to be used for the MAC calculation, especially when the KDF_alg produces fewer bits than the key length required for the MAC_alg.
> 
> <snip>
>    The output of multiple PRF invocations is simply concatenated.  For
>    the Traffic_Key, values of multiple PRF invocations are concatenated
>    and truncated as needed to create a Traffic_Key of the desired
>    length.  For instance, if one were using KDF_HMAC_SHA1, which uses a
>    160-bit internal PRF to generate 320 bits of data, one would execute
>    the PRF twice, once with i=1 and once with i=2.  The result would be
>    the entire output of the first invocation concatenated with the
>    second invocation.  For example,
> 
>   Traffic_Key =
>           KDF_alg(Master_Key, 1 || Label || Context || Output_length) ||
>           KDF_alg(Master_Key, 2 || Label || Context || Output_length)
> 
>    If the number of bits required is not an exact multiple of the output
>    size of the PRF, then the output of the final invocation of the PRF
>    is truncated as necessary.
> </snip>
> 
> The question I have is, what if the first invocation of the above PRF itself produces more bits than the key length required by the MAC calculation. Should the output of the first invocation be truncated?

In that case, the first invocation of PRF is also the “final” invocation, as mentioned in the last paragraph, because you have enough bits. So yes, then you truncate.

> For e.g. if one were to use AES-128-CMAC-96 as the MAC_alg and KDF_HMAC_SHA1 as the KDF_alg, should the output of the foll. be truncated to 128 bits (since it would produce a 160 bit output whereas AES-128-CMAC requires a 128-bit key)?
> KDF_alg(Master_Key, 1 || Label || Context || Output_length)

Yes; I don’t understand why this seems unambiguous.

> 
> Regards,
> Muthu
> _______________________________________________
> tcpm mailing list
> tcpm@ietf.org
> https://www.ietf.org/mailman/listinfo/tcpm