From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org, Ahmad Fatoum <a.fatoum@barebox.org>
Cc: jre@pengutronix.de, Lukas Wunner <lukas@wunner.de>
Subject: Re: [PATCH 1/3] crypto: ecc - Fix carry overflow in vli multiplication
Date: Mon, 26 Oct 2026 14:04:55 +0100 [thread overview]
Message-ID: <179301989542.204598.3773962505554260627.b4-ty@pengutronix.de> (raw)
In-Reply-To: <20261025085451.2871310-1-a.fatoum@barebox.org>
On Sun, 25 Oct 2026 09:54:44 +0100, Ahmad Fatoum wrote:
> This is an adoption of the corresponding Linux commit:
>
> | commit 27b536a2ec8e2f85a0380c2d13c9ecbc7aaab406
> |
> | crypto: ecc - Fix carry overflow in vli multiplication
> |
> | The carry flag calculation fails when r01.m_high is saturated
> | (0xFFFFFFFFFFFFFFFF) and addition of lower bits overflows.
> |
> | The condition (r01.m_high < product.m_high) doesn't handle the case
> | where r01.m_high == product.m_high and an additional carry exists
> | from lower-bit overflow.
> |
> | When commit 3c4b23901a0c ("crypto: ecdh - Add ECDH software support")
> | introduced crypto/ecc.c, it split the muladd() function in the
> | micro-ecc library into separate mul_64_64() and add_128_128() helpers.
> | It seems the check got lost in translation.
> |
> | Add proper handling for this boundary by accounting for the carry
> | from the lower addition.
> |
> | Fixes: 3c4b23901a0c ("crypto: ecdh - Add ECDH software support")
> | Signed-off-by: Anastasia Tishchenko <sv3iry@gmail.com>
> | Cc: stable@vger.kernel.org # v4.8+
> | Reviewed-by: Lukas Wunner <lukas@wunner.de>
> | Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
>
> [...]
Applied, thanks!
[1/3] crypto: ecc - Fix carry overflow in vli multiplication
https://git.pengutronix.de/cgit/barebox/commit/?id=ee1ddfaf4e91 (link may not be stable)
[2/3] crypto: ecc - Optimize vli additive operations using compiler builtins
https://git.pengutronix.de/cgit/barebox/commit/?id=a6a5e2e775ea (link may not be stable)
[3/3] crypto: ecc - Handle exceptional points in Shamir multiplication
https://git.pengutronix.de/cgit/barebox/commit/?id=7423e4755ecd (link may not be stable)
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
prev parent reply other threads:[~2026-10-26 13:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-25 8:54 Ahmad Fatoum
2026-10-25 8:54 ` [PATCH 2/3] crypto: ecc - Optimize vli additive operations using compiler builtins Ahmad Fatoum
2026-10-25 8:54 ` [PATCH 3/3] crypto: ecc - Handle exceptional points in Shamir multiplication Ahmad Fatoum
2026-10-26 13:04 ` Sascha Hauer [this message]
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=179301989542.204598.3773962505554260627.b4-ty@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=a.fatoum@barebox.org \
--cc=barebox@lists.infradead.org \
--cc=jre@pengutronix.de \
--cc=lukas@wunner.de \
/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