mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-18 05:42:35 +00:00
bignum_mod: Fixed code-style
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
This commit is contained in:
parent
f055ad61dc
commit
0f718c9ed0
@ -137,9 +137,9 @@ cleanup:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline void standard_modulus_setup(mbedtls_mpi_mod_modulus *N,
|
static inline void standard_modulus_setup(mbedtls_mpi_mod_modulus *N,
|
||||||
const mbedtls_mpi_uint *p,
|
const mbedtls_mpi_uint *p,
|
||||||
size_t p_limbs,
|
size_t p_limbs,
|
||||||
mbedtls_mpi_mod_rep_selector int_rep)
|
mbedtls_mpi_mod_rep_selector int_rep)
|
||||||
{
|
{
|
||||||
N->p = p;
|
N->p = p;
|
||||||
N->limbs = p_limbs;
|
N->limbs = p_limbs;
|
||||||
@ -169,7 +169,7 @@ int mbedtls_mpi_mod_optred_modulus_setup(mbedtls_mpi_mod_modulus *N,
|
|||||||
mbedtls_mpi_opt_red_struct *ored)
|
mbedtls_mpi_opt_red_struct *ored)
|
||||||
{
|
{
|
||||||
standard_modulus_setup(N, p, p_limbs, MBEDTLS_MPI_MOD_REP_OPT_RED);
|
standard_modulus_setup(N, p, p_limbs, MBEDTLS_MPI_MOD_REP_OPT_RED);
|
||||||
N->rep.ored =ored ;
|
N->rep.ored = ored;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ void mpi_mod_mul(char *input_A,
|
|||||||
mbedtls_mpi_mod_modulus_init(&m);
|
mbedtls_mpi_mod_modulus_init(&m);
|
||||||
|
|
||||||
TEST_EQUAL(mbedtls_test_read_mpi_modulus(&m, input_N,
|
TEST_EQUAL(mbedtls_test_read_mpi_modulus(&m, input_N,
|
||||||
MBEDTLS_MPI_MOD_REP_MONTGOMERY), 0);
|
MBEDTLS_MPI_MOD_REP_MONTGOMERY), 0);
|
||||||
|
|
||||||
TEST_EQUAL(test_read_residue(&rA, &m, input_A, 0), 0);
|
TEST_EQUAL(test_read_residue(&rA, &m, input_A, 0), 0);
|
||||||
TEST_EQUAL(test_read_residue(&rB, &m, input_B, 0), 0);
|
TEST_EQUAL(test_read_residue(&rB, &m, input_B, 0), 0);
|
||||||
@ -198,7 +198,7 @@ void mpi_mod_mul_neg(char *input_A,
|
|||||||
mbedtls_mpi_mod_modulus_init(&fake_m);
|
mbedtls_mpi_mod_modulus_init(&fake_m);
|
||||||
|
|
||||||
TEST_EQUAL(mbedtls_test_read_mpi_modulus(&m, input_N,
|
TEST_EQUAL(mbedtls_test_read_mpi_modulus(&m, input_N,
|
||||||
MBEDTLS_MPI_MOD_REP_MONTGOMERY), 0);
|
MBEDTLS_MPI_MOD_REP_MONTGOMERY), 0);
|
||||||
|
|
||||||
TEST_EQUAL(test_read_residue(&rA, &m, input_A, 1), 0);
|
TEST_EQUAL(test_read_residue(&rA, &m, input_A, 1), 0);
|
||||||
TEST_EQUAL(test_read_residue(&rB, &m, input_B, 1), 0);
|
TEST_EQUAL(test_read_residue(&rB, &m, input_B, 1), 0);
|
||||||
@ -245,7 +245,7 @@ void mpi_mod_sub(char *input_N,
|
|||||||
|
|
||||||
TEST_EQUAL(0,
|
TEST_EQUAL(0,
|
||||||
mbedtls_test_read_mpi_modulus(&m, input_N,
|
mbedtls_test_read_mpi_modulus(&m, input_N,
|
||||||
MBEDTLS_MPI_MOD_REP_MONTGOMERY));
|
MBEDTLS_MPI_MOD_REP_MONTGOMERY));
|
||||||
|
|
||||||
/* test_read_residue() normally checks that inputs have the same number of
|
/* test_read_residue() normally checks that inputs have the same number of
|
||||||
* limbs as the modulus. For negative testing we can ask it to skip this
|
* limbs as the modulus. For negative testing we can ask it to skip this
|
||||||
@ -347,7 +347,7 @@ void mpi_mod_inv_mont(char *input_N,
|
|||||||
|
|
||||||
TEST_EQUAL(0,
|
TEST_EQUAL(0,
|
||||||
mbedtls_test_read_mpi_modulus(&N, input_N,
|
mbedtls_test_read_mpi_modulus(&N, input_N,
|
||||||
MBEDTLS_MPI_MOD_REP_MONTGOMERY));
|
MBEDTLS_MPI_MOD_REP_MONTGOMERY));
|
||||||
|
|
||||||
/* test_read_residue() normally checks that inputs have the same number of
|
/* test_read_residue() normally checks that inputs have the same number of
|
||||||
* limbs as the modulus. For negative testing we can ask it to skip this
|
* limbs as the modulus. For negative testing we can ask it to skip this
|
||||||
@ -397,7 +397,7 @@ void mpi_mod_inv_non_mont(char *input_N,
|
|||||||
|
|
||||||
TEST_EQUAL(0,
|
TEST_EQUAL(0,
|
||||||
mbedtls_test_read_mpi_modulus(&N, input_N,
|
mbedtls_test_read_mpi_modulus(&N, input_N,
|
||||||
MBEDTLS_MPI_MOD_REP_OPT_RED));
|
MBEDTLS_MPI_MOD_REP_OPT_RED));
|
||||||
|
|
||||||
/* test_read_residue() normally checks that inputs have the same number of
|
/* test_read_residue() normally checks that inputs have the same number of
|
||||||
* limbs as the modulus. For negative testing we can ask it to skip this
|
* limbs as the modulus. For negative testing we can ask it to skip this
|
||||||
@ -448,7 +448,7 @@ void mpi_mod_add(char *input_N,
|
|||||||
|
|
||||||
TEST_EQUAL(0,
|
TEST_EQUAL(0,
|
||||||
mbedtls_test_read_mpi_modulus(&m, input_N,
|
mbedtls_test_read_mpi_modulus(&m, input_N,
|
||||||
MBEDTLS_MPI_MOD_REP_MONTGOMERY));
|
MBEDTLS_MPI_MOD_REP_MONTGOMERY));
|
||||||
|
|
||||||
/* test_read_residue() normally checks that inputs have the same number of
|
/* test_read_residue() normally checks that inputs have the same number of
|
||||||
* limbs as the modulus. For negative testing we can ask it to skip this
|
* limbs as the modulus. For negative testing we can ask it to skip this
|
||||||
|
Loading…
x
Reference in New Issue
Block a user