Re: [Cfrg] Efficient side channel resistance for X25519..

Phillip Hallam-Baker <> Sat, 09 November 2019 22:05 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 8EE091200FF for <>; Sat, 9 Nov 2019 14:05:51 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.646
X-Spam-Status: No, score=-1.646 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=no autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id 7-82uu8DWknz for <>; Sat, 9 Nov 2019 14:05:50 -0800 (PST)
Received: from ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 2655B120090 for <>; Sat, 9 Nov 2019 14:05:50 -0800 (PST)
Received: by with SMTP id t4so8308257otr.1 for <>; Sat, 09 Nov 2019 14:05:50 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ffdVr0rRZ+o6yhpK9NNFDOYBP5u/iInc5yXeofujrxU=; b=FCWKOcAKRRkcuhW8d/3l/Q0ljVFQxTSsmiV2d0jEFs3dCA9J1pASZ+aKi+tkVJ2IVW J03mf0unPvhg4y+sGRkNtC4+LChLQrG2dmljJbtOtaCzSCmoP8YjvRt0F/dcYX/+AbFv tiU3HbfzVGZQI/DXbIJu0snLZC4hT5fCABLTwgYUGuXU15FfUJxU/FomHeUOE86c2DQ0 d70n0jmHL7gVsKqc65TzVilgnfVzM+8CQcQJDo0E/ClVZRpTtu4+gakX3CyZk/Kg57DD 7SruPe+YCRnH864ysUEyJMVv44KNC3V0LzaI/BjdM17u10BXPOYtpAKlqeQMcChuZb52 y9Bg==
X-Gm-Message-State: APjAAAXWggVWVmaro1kdUuhp0N7QNCGm4YLZZJ0nmvkZC3PU/FueCAwN /iX/RLnysdf0ItnTb9z9aurtpwxr7WPekJVHDRxn+Q==
X-Google-Smtp-Source: APXvYqx/If+AXShBhEBJur7li5RuYg/bnCsidjak6FEN4V1weMk0dMrKLD22ODI7p8saXeEBtYFtnJ7kQNoTf2mBjfo=
X-Received: by 2002:a9d:7441:: with SMTP id p1mr14261584otk.87.1573337149204; Sat, 09 Nov 2019 14:05:49 -0800 (PST)
MIME-Version: 1.0
References: <> <>
In-Reply-To: <>
From: Phillip Hallam-Baker <>
Date: Sat, 9 Nov 2019 17:05:38 -0500
Message-ID: <>
To: "Riad S. Wahby" <>
Content-Type: multipart/alternative; boundary="000000000000e3edb70596f1191c"
Archived-At: <>
Subject: Re: [Cfrg] Efficient side channel resistance for X25519..
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Crypto Forum Research Group <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Sat, 09 Nov 2019 22:05:51 -0000

On Sat, Nov 9, 2019 at 2:07 PM Riad S. Wahby <> wrote:

> Phillip Hallam-Baker <> wrote:
> > I can make the code work but I am not a number theorist so if anyone
> could
> > help, I would appreciate it.
> This is more like a vague memory than a clear answer (sorry):
> In Mike Hamburg's Decaf paper (, Appx. B
> describes a method of recovering the y-coordinate while avoiding
> an extra square-root computation, essentially by remembering some
> intermediate values during the ladder computation.
> I haven't thought at all about whether a similar trick can be used
> in the non-Decaf context, but it might be worth taking a look.
> (As a general comment---and from your email, it appears we're in
> agreement---masking via randomization is good, but probably it's
> best to think of it as insurance: a masked implementation that's
> non-constant-time is toast in the face of randomness failures.)

Thanks for the pointer. I agree that belt and braces is best. But in this
particular case we seemed to have gone for a not particularly reliable belt
and ignored the suspender option.

The other concern of course will be the possibility some troll has got a
'do it on the radio' type patent on Kocher's work of 25 years ago. We
should probably check into that.