From cd860dfe0290d21afd69bcc0cae18f8dc6a4d170 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Thu, 18 Aug 2022 16:23:05 +0100 Subject: [PATCH] bignum_mod: Added Montgomery constants This patch adds the Montgomery constants to the `mbedtls_mpi_mont_struct`. Signed-off-by: Minos Galanakis --- library/bignum_mod.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/bignum_mod.h b/library/bignum_mod.h index c25eb8742..3b3338c2d 100644 --- a/library/bignum_mod.h +++ b/library/bignum_mod.h @@ -53,7 +53,11 @@ typedef struct size_t limbs; } mbedtls_mpi_mod_residue; -typedef void *mbedtls_mpi_mont_struct; +typedef struct { + mbedtls_mpi_uint const *rr; /* The residue for 2^{2*n*biL} mod N */ + mbedtls_mpi_uint mm; /* Montgomery const for -N^{-1} mod 2^{ciL} */ +} mbedtls_mpi_mont_struct; + typedef void *mbedtls_mpi_opt_red_struct; typedef struct {