summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2021-11-09 16:55:30 -0600
committerCommit Bot <commit-bot@chromium.org>2021-11-18 04:50:46 +0000
commit543a18ecf75480886e15a7be48e57c9271ab5333 (patch)
tree4b4709853507ebcb92b526ed32c2903e6a2ea5ce /common
parent39bc3a4c0d3132551151298efcf3bf12c3bc10a4 (diff)
downloadchrome-ec-543a18ecf75480886e15a7be48e57c9271ab5333.tar.gz
Revert "rsa: Further optimization of multiplications for Cortex-M0"
This reverts commit ecd0d1b5767c829f4c73a79a9eb6abae343284fb. BUG=b:200823466 TEST=make buildall -j Change-Id: I1229e86f015e1a04ee8026abd2f647d6039125fd Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273423 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/rsa.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/rsa.c b/common/rsa.c
index 10f0afa4b4..9350f88554 100644
--- a/common/rsa.c
+++ b/common/rsa.c
@@ -56,8 +56,8 @@ static void mont_mul_add(const struct rsa_public_key *key,
uint32_t i;
for (i = 1; i < RSANUMWORDS; ++i) {
- A = mulaa32(a, b[i], c[i], A >> 32);
- B = mulaa32(d0, key->n[i], A, B >> 32);
+ A = (A >> 32) + mula32(a, b[i], c[i]);
+ B = (B >> 32) + mula32(d0, key->n[i], A);
c[i - 1] = (uint32_t)B;
}
@@ -82,7 +82,7 @@ static void mont_mul_add_0(const struct rsa_public_key *key,
uint32_t i;
for (i = 1; i < RSANUMWORDS; ++i) {
- B = mulaa32(d0, key->n[i], c[i], B >> 32);
+ B = (B >> 32) + mula32(d0, key->n[i], c[i]);
c[i - 1] = (uint32_t)B;
}