ell.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz at gmail.com>
To: ell at lists.01.org
Subject: Re: [PATCH] ecc: make l_ecc_point_from_data const time (for compressed points)
Date: Thu, 03 Feb 2022 10:06:30 -0600	[thread overview]
Message-ID: <62af0698-a957-3d5d-844c-8d1af295ab38@gmail.com> (raw)
In-Reply-To: 20220112224055.1308675-1-prestwoj@gmail.com

[-- Attachment #1: Type: text/plain, Size: 1088 bytes --]

Hi James,

On 1/12/22 16:40, James Prestwood wrote:
> This only alters the two compressed point types as there isn't a security
> reason to make the function const time for compliant/full point data as
> these are never used in conjunction with compressed points.
> 
> The timing difference came down mainly to the conditional _vli_mod_sub call
> which was only called depending on the first bit of p->y. More subtly the
> check differered between BIT0 and BIT1 by a '!' operation which would result
> in an additional instruction.
> 
> This patch addresses the '!' operation by checking if the subtraction is
> needed and considering both compressed types in that logic.
> 
> For the subtraction, it is now done unconditionally and the result is stored
> in a temporary variable. Then l_secure_select is used to copy the data to
> p->y, or back into the temporary variable depending on if 'need_sub' evaluated
> to true.
> ---
>   ell/ecc.c | 20 ++++++++++----------
>   1 file changed, 10 insertions(+), 10 deletions(-)
> 

Applied, thanks.

Regards,
-Denis

             reply	other threads:[~2022-02-03 16:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-03 16:06 Denis Kenzior [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-01-12 22:40 [PATCH] ecc: make l_ecc_point_from_data const time (for compressed points) James Prestwood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=62af0698-a957-3d5d-844c-8d1af295ab38@gmail.com \
    --to=ell@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).