[TLS] draft-ietf-tls-curve25519-01 and the X25519 significant bit.

Adam Langley <agl@imperialviolet.org> Tue, 22 December 2015 18:52 UTC

Return-Path: <alangley@gmail.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 607791A8740 for <tls@ietfa.amsl.com>; Tue, 22 Dec 2015 10:52:31 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.278
X-Spam-Level:
X-Spam-Status: No, score=-1.278 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, SPF_PASS=-0.001] autolearn=no
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 fNN-CzWdBrok for <tls@ietfa.amsl.com>; Tue, 22 Dec 2015 10:52:30 -0800 (PST)
Received: from mail-qg0-x235.google.com (mail-qg0-x235.google.com [IPv6:2607:f8b0:400d:c04::235]) (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 4D5FF1A8A82 for <tls@ietf.org>; Tue, 22 Dec 2015 10:52:29 -0800 (PST)
Received: by mail-qg0-x235.google.com with SMTP id c96so117226490qgd.3 for <tls@ietf.org>; Tue, 22 Dec 2015 10:52:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:cc:content-type; bh=y94EdjLECSEmZK6/eBiZXDlz9oth5hoNip3S80m2nek=; b=BSNJwZ0Indlc+FtnivUV4/W/SUQwdLE8Y2p/heesNlXb6yQnorGMgqwRIhgqFmsQqW sEyohaiiK+15wOB0ryuYeN/atRXyuCXKDiV/V52apzot5tcTtk5btx24B48WSq79J9s+ /uPOV53vA7PGYMO0oeY5irNOj+rpnFXvlLOB8n4We6fA/Vp8JQjyMJmvOvywp9HqZhDJ +rVLKBBHMXhTcDqOmTXe3geqbYEfBDJ0DVcOLDkzBQmiMuCW7IiVebYr5IlUO+lZgCsf ZEbjqyKtTxABq97Isp315KlOp8+egfNI1Xleup2lnc6NTcmygeDXqEGCGxdS+Rdhxq2h 9h+w==
MIME-Version: 1.0
X-Received: by 10.140.227.199 with SMTP id x190mr36798072qhb.46.1450810348477; Tue, 22 Dec 2015 10:52:28 -0800 (PST)
Sender: alangley@gmail.com
Received: by 10.140.93.12 with HTTP; Tue, 22 Dec 2015 10:52:28 -0800 (PST)
Date: Tue, 22 Dec 2015 10:52:28 -0800
X-Google-Sender-Auth: bu4Kc-JrOrh3plCHfFDHveeDqGY
Message-ID: <CAMfhd9XDfwmoze+BdFVedhCGDQRNbL63ZT=KZc-7dEr0UMk4dA@mail.gmail.com>
From: Adam Langley <agl@imperialviolet.org>
To: "tls@ietf.org" <tls@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Archived-At: <http://mailarchive.ietf.org/arch/msg/tls/qGER6rZxVKHEHzqgWxKknAexDHQ>
Cc: Simon Josefsson <simon@josefsson.org>
Subject: [TLS] draft-ietf-tls-curve25519-01 and the X25519 significant bit.
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.15
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: Tue, 22 Dec 2015 18:52:31 -0000

Curve25519, as the name suggests, operates on 255-bit numbers. When
encoded as bytes, there's obviously a 256th bit that needs to be
specified.

Curve25519 implementations didn't set the bit but did used to vary on
how they parsed it. Some would take a 256-bit number and reduce it
while others would ignore the bit completely.

However, I believe that implementations have converged on ignoring it.
That behaviour is specified in draft-irtf-cfrg-curves and tested via
the test vectors.

Currently https://tools.ietf.org/html/draft-ietf-tls-curve25519-01#section-2.3
says that implementations SHOULD reject inputs with the high-bit set.
I think that should be dropped. The X25519 function is specified in
terms of bytes in draft-irtf-cfrg-curves and I think the TLS spec
should just use that draft.


Cheers

AGL

-- 
Adam Langley agl@imperialviolet.org https://www.imperialviolet.org