[PATCH] mpi/ec-nist: fix NIST-P224 failing on 32-bit architectures
Jussi Kivilinna <[email protected]> Sat, 5 Apr 2025 16:15:55 +0300
| Newsgroups | gmane.comp.encryption.gpg.libgcrypt.devel |
|---|---|
| Message-ID | <[email protected]> |
* mpi/ec-nist.c (_gcry_mpi_ec_nist224_mod): Adjust output limb size of number of limbs in mpi_limb64_t is greater than one. -- Signed-off-by: Jussi Kivilinna <[email protected]> --- mpi/ec-nist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpi/ec-nist.c b/mpi/ec-nist.c index 36357476..317c0ed6 100644 --- a/mpi/ec-nist.c +++ b/mpi/ec-nist.c @@ -266,7 +266,7 @@ _gcry_mpi_ec_nist224_mod (gcry_mpi_t w, mpi_ec_t ctx) STORE64_COND(wp, 2, mask2, d[2], mask1, s[2]); STORE64_COND(wp, 3, mask2, d[3], mask1, s[3]); - w->nlimbs = wsize * LIMBS_PER_LIMB64; + w->nlimbs = wsize * LIMBS_PER_LIMB64 - (LIMBS_PER_LIMB64 - 1); if (!(ctx->flags & GCRYECC_FLAG_LEAST_LEAK)) MPN_NORMALIZE (wp, w->nlimbs); } -- 2.45.2