[TLS] Diffie-Hellman: value of Z - the shared secret - without leading zero octets

Maarten Bodewes <maarten.bodewes@gmail.com> Mon, 28 March 2016 15:58 UTC

Return-Path: <maarten.bodewes@gmail.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 DAC3812DB93 for <tls@ietfa.amsl.com>; Mon, 28 Mar 2016 08:58:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.699
X-Spam-Level:
X-Spam-Status: No, score=-2.699 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 jGzMbeb5scUD for <tls@ietfa.amsl.com>; Mon, 28 Mar 2016 08:58:34 -0700 (PDT)
Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1AB5D12DB87 for <tls@ietf.org>; Mon, 28 Mar 2016 08:56:46 -0700 (PDT)
Received: by mail-wm0-x22b.google.com with SMTP id 127so27917932wmu.1 for <tls@ietf.org>; Mon, 28 Mar 2016 08:56:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to; bh=aoRB87KrGKu8L+KcraKNUyE7E9GfiH06Ey/H4t9uzmw=; b=osUMs9wfojk4a7jC5IRjS4SS6GI3TH78B1xzD+vgjD5ZqR0yLCiL5Jg/9SFbf6ogM3 feuqlogA0bWaB49eLHR5LxK+ZNmMVV09FcPfSOsZWreCG2eY45dwaAnbwqdFkCKPHNGR 6pDGKMDh/MyPaaNohcTNq30Z3tH6D1JGFaxJ3SsgjhiwQvqGswvc7zEs8a2TCqwz20cz SkPef8Gb3hfejEFp6yN/eZRG0LetEhQWO5ABAizaeGYwY/wlY0e+pMFdN9DVeXJIrs8I Et6C3Uz03JxqlqLsA/TeBHPBBJc6Ecvi6CVf6noQIiMDC+g0OJvuDRIL0V+GO+lSqzI/ jgaQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=aoRB87KrGKu8L+KcraKNUyE7E9GfiH06Ey/H4t9uzmw=; b=iINTbwz6kPvAhNzlEpqShHieoalADjZJikpZ4heK6hLv0cviK+MmgWsM01nB9fm1dj 3p6Ty7EAY7Dxh8pwLJmVGFFnsiqYUewQ8wiU/CmgpkUL1e/vU8VWkwSFpBBPLroL4a1E HAwpYeJg3CIshanAKjQgGIRcA1zsncWagHNLtjMVzVpJcZehy3K4U+TqaToIFHC4wcaf V0QuLtL+nXY9Lq4JH+cvg0PXi60AReGRarRLFaki4NzsqthkgXGFUUmZ4IpXNHKt97Z/ IVHpA+i8QkJJJ1dTq8yD8zA+v7ZEUwQWlBLNR9ncVwDR9ws95tIp+1EmodQ+AHBmwePE 2gYA==
X-Gm-Message-State: AD7BkJLijTXSt8grnuLkG1kbD1kci1nXAX0UhC/GGoNYK+8SYiaIYfKXrYJzPLpOtWilEQbrSqgjhtSWaT/B2g==
MIME-Version: 1.0
X-Received: by 10.194.71.70 with SMTP id s6mr28957561wju.1.1459180604666; Mon, 28 Mar 2016 08:56:44 -0700 (PDT)
Received: by 10.28.55.146 with HTTP; Mon, 28 Mar 2016 08:56:44 -0700 (PDT)
Date: Mon, 28 Mar 2016 17:56:44 +0200
Message-ID: <CADwHJ+9XCpEDtX6vE+TQXKwz1MEhXHkj5Xbua6vAY_03Q=6LDA@mail.gmail.com>
From: Maarten Bodewes <maarten.bodewes@gmail.com>
To: "tls@ietf.org" <tls@ietf.org>
Content-Type: multipart/alternative; boundary="047d7bd91b7e9abcf5052f1df575"
Archived-At: <http://mailarchive.ietf.org/arch/msg/tls/LGkDO7EEOHS4gRuTyN6tR52L4Yk>
Subject: [TLS] Diffie-Hellman: value of Z - the shared secret - without leading zero octets
X-BeenThere: tls@ietf.org
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." <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: Mon, 28 Mar 2016 15:58:36 -0000

Hi all,

I see that the leading zero is stripped off of the value of Z (the shared
secret) before it is used as input to HKDF. This seems to be compatible
with TLS 1.2. Then again, it is not compatible with e.g. NISP800-56A which
uses the value of Z with the same size of the prime in octets. Furthermore,
it is also different with regards to handling the coordinate X as used in
ECDH.

Was this a conscious decision to keep compatibility with TLS? Has the use
of the value of Z including zero octets been considered?

Regards,
Maarten