Re: [TLS] Curve25519 in TLS and Additional Curves in TLS

Nikos Mavrogiannopoulos <nmav@redhat.com> Thu, 10 April 2014 08:22 UTC

Return-Path: <nmav@redhat.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 1A70E1A0158 for <tls@ietfa.amsl.com>; Thu, 10 Apr 2014 01:22:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.174
X-Spam-Level:
X-Spam-Status: No, score=-7.174 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.272, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham
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 fDDFuWzz-Z5p for <tls@ietfa.amsl.com>; Thu, 10 Apr 2014 01:22:52 -0700 (PDT)
Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by ietfa.amsl.com (Postfix) with ESMTP id 34C1E1A0153 for <tls@ietf.org>; Thu, 10 Apr 2014 01:22:52 -0700 (PDT)
Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s3A8MmRU016780 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 10 Apr 2014 04:22:48 -0400
Received: from [10.34.2.127] (dhcp-2-127.brq.redhat.com [10.34.2.127]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s3A8MkS9005256 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 10 Apr 2014 04:22:47 -0400
Message-ID: <1397118165.2419.23.camel@dhcp-2-127.brq.redhat.com>
From: Nikos Mavrogiannopoulos <nmav@redhat.com>
To: Watson Ladd <watsonbladd@gmail.com>
Date: Thu, 10 Apr 2014 10:22:45 +0200
In-Reply-To: <CACsn0ckyaGO9hqn7pDVE2VR-TWs5v+Y6NsnCqCvrwFGyUGfZ3A@mail.gmail.com>
References: <87ob3456s1.fsf@latte.josefsson.org> <20140402164340.GA14790@roeckx.be> <20140407115102.3011d2e5@latte.josefsson.org> <CACsn0cmFLO2n8d-FVVb4wu=G5T88E7rRd8b=eYo-1uMZnMxkOQ@mail.gmail.com> <5344BD77.2020106@fifthhorseman.net> <2A0EFB9C05D0164E98F19BB0AF3708C7120AC18CAE@USMBX1.msg.corp.akamai.com> <1397044231.4019.4.camel@dhcp-2-127.brq.redhat.com> <4abda243-3fc2-4087-92f8-3db02769384f@email.android.com> <1397048457.4019.22.camel@dhcp-2-127.brq.redhat.com> <CACsn0ckyaGO9hqn7pDVE2VR-TWs5v+Y6NsnCqCvrwFGyUGfZ3A@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27
Archived-At: http://mailarchive.ietf.org/arch/msg/tls/6HkWzGi7X-xgHbdZsDqzdgn4YTc
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] Curve25519 in TLS and Additional Curves in TLS
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: <http://www.ietf.org/mail-archive/web/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: Thu, 10 Apr 2014 08:22:53 -0000

On Wed, 2014-04-09 at 08:00 -0700, Watson Ladd wrote:

> In fact, because you are the GnuTLS developer, I know exactly what
> your bignum library, gmp does. And it isn't pretty: operations can
> take different paths depending on argument size, which includes
> lopping off zero limbs. Modulo is computed by division, which involves
> an instruction that is notoriously variable-time on many
> architectures.

And how does this affect an ephemeral key exchange? I'll reply for you.
It has no effect, because it is an ephemeral key exchange.

Being constant time, _matters_ when you do operations on a long-term
key, not when you do one operation on a one-time-key. So in the cases
where it matters nettle (the crypto library used by gnutls), is constant
time, and outperforms all other implementations so far.

> Your bignum implementation is also slow. 

See the point above. I'd be interested to know how you figured that gmp
is slow.

btw. I never mentioned implementing curve25519 using gmp or otherwise,
because I am not going to implement the low level part of it. That's why
I asked input from other who plan to implement it. 

> If you do decide to persist in this folly, reversing the bytes won't
> stop you, sadly. But I wish it could.

Please keep your poison for yourself.

regards,
Nikos