diff options
author | Angel Baez <51308340+abaez004@users.noreply.github.com> | 2024-02-07 10:34:48 -0500 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2024-02-09 10:34:58 +0100 |
commit | 59416d6fce255cd582fa753293bcaea4aad13be8 (patch) | |
tree | 7252689393a52153badd23f6da801617ca24da2f | |
parent | f3875dad4bca7d62c54a24ca920c06492020ce64 (diff) |
Rearrange terms in gf_mul to prevent segfault
CLA: trivial
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23512)
(cherry picked from commit 76cecff5e9bedb2bafc60062283f99722697082a)
-rw-r--r-- | crypto/ec/curve448/arch_64/f_impl64.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/ec/curve448/arch_64/f_impl64.c b/crypto/ec/curve448/arch_64/f_impl64.c index 8f7a7dd391..4555b3c29a 100644 --- a/crypto/ec/curve448/arch_64/f_impl64.c +++ b/crypto/ec/curve448/arch_64/f_impl64.c @@ -45,9 +45,9 @@ void gf_mul(gf_s * RESTRICT cs, const gf as, const gf bs) accum0 += widemul(a[j + 4], b[i - j + 4]); } for (; j < 4; j++) { - accum2 += widemul(a[j], b[i - j + 8]); - accum1 += widemul(aa[j], bbb[i - j + 4]); - accum0 += widemul(a[j + 4], bb[i - j + 4]); + accum2 += widemul(a[j], b[i + 8 - j]); + accum1 += widemul(aa[j], bbb[i + 4 - j]); + accum0 += widemul(a[j + 4], bb[i + 4 - j]); } accum1 -= accum2; |