Bignum: extract bignum_mod.h functions

Extract functions declared in bignum_mod.h into a source file with a
matching name.

We are doing this because:

- This is a general best practice/convention
- We hope that this will make resolving merge conflicts in the future
  easier
- Having them in a unified source file is a premature optimisation at
  this point

This makes library/bignum_new.c empty and therefore it is deleted.

Signed-off-by: Janos Follath <janos.follath@arm.com>
This commit is contained in:
Janos Follath 2022-08-09 13:44:53 +01:00
parent 0ded631879
commit d1baedb786
4 changed files with 8 additions and 7 deletions

View file

@ -2010,9 +2010,9 @@
* Enable the multi-precision integer library.
*
* Module: library/bignum.c
* library/bignum_new.c
* library/bignum_core.c
* library/bignum_mod_raw.c
* library/bignum_mod.c
* Caller: library/dhm.c
* library/ecp.c
* library/ecdsa.c

View file

@ -18,9 +18,9 @@ set(src_crypto
asn1write.c
base64.c
bignum.c
bignum_new.c
bignum_core.c
bignum_mod_raw.c
bignum_mod.c
camellia.c
ccm.c
chacha20.c

View file

@ -83,9 +83,9 @@ OBJS_CRYPTO= \
asn1write.o \
base64.o \
bignum.o \
bignum_new.o \
bignum_core.o \
bignum_mod_raw.o \
bignum_mod.o \
camellia.o \
ccm.o \
chacha20.o \

View file

@ -26,10 +26,6 @@
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/bignum.h"
#include "bignum_core.h"
#include "bignum_mod.h"
#include "bignum_mod_raw.h"
#include "constant_time_internal.h"
#if defined(MBEDTLS_PLATFORM_C)
#include "mbedtls/platform.h"
@ -41,6 +37,11 @@
#define mbedtls_free free
#endif
#include "bignum_core.h"
#include "bignum_mod.h"
#include "bignum_mod_raw.h"
#include "constant_time_internal.h"
int mbedtls_mpi_mod_residue_setup( mbedtls_mpi_mod_residue *r,
mbedtls_mpi_mod_modulus *m,
mbedtls_mpi_uint *p,