Gabor Mezei | 9684d4d | 2023-01-16 16:50:11 +0100 | [diff] [blame] | 1 | /** |
Gabor Mezei | aaa1d2a | 2023-01-23 16:13:43 +0100 | [diff] [blame] | 2 | * \file bignum_mod_raw_invasive.h |
Gabor Mezei | 9684d4d | 2023-01-16 16:50:11 +0100 | [diff] [blame] | 3 | * |
Gabor Mezei | aaa1d2a | 2023-01-23 16:13:43 +0100 | [diff] [blame] | 4 | * \brief Function declarations for invasive functions of Low-level |
| 5 | * modular bignum. |
Gabor Mezei | 9684d4d | 2023-01-16 16:50:11 +0100 | [diff] [blame] | 6 | */ |
| 7 | /** |
| 8 | * Copyright The Mbed TLS Contributors |
Dave Rodgman | 16799db | 2023-11-02 19:47:20 +0000 | [diff] [blame] | 9 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
Gabor Mezei | 9684d4d | 2023-01-16 16:50:11 +0100 | [diff] [blame] | 10 | */ |
| 11 | |
Gabor Mezei | aaa1d2a | 2023-01-23 16:13:43 +0100 | [diff] [blame] | 12 | #ifndef MBEDTLS_BIGNUM_MOD_RAW_INVASIVE_H |
| 13 | #define MBEDTLS_BIGNUM_MOD_RAW_INVASIVE_H |
Gabor Mezei | 9684d4d | 2023-01-16 16:50:11 +0100 | [diff] [blame] | 14 | |
| 15 | #include "common.h" |
| 16 | #include "mbedtls/bignum.h" |
| 17 | #include "bignum_mod.h" |
| 18 | |
Gabor Mezei | e81a2b8 | 2023-01-23 18:56:38 +0100 | [diff] [blame] | 19 | #if defined(MBEDTLS_TEST_HOOKS) |
| 20 | |
Gabor Mezei | a24fd06 | 2023-01-23 19:10:26 +0100 | [diff] [blame] | 21 | /** Convert the result of a quasi-reduction to its canonical representative. |
Gabor Mezei | c83f792 | 2023-01-17 13:28:06 +0100 | [diff] [blame] | 22 | * |
| 23 | * \param[in,out] X The address of the MPI to be converted. Must have the |
Gabor Mezei | a24fd06 | 2023-01-23 19:10:26 +0100 | [diff] [blame] | 24 | * same number of limbs as \p N. The input value must |
| 25 | * be in range 0 <= X < 2N. |
Gabor Mezei | c83f792 | 2023-01-17 13:28:06 +0100 | [diff] [blame] | 26 | * \param[in] N The address of the modulus. |
Gabor Mezei | c83f792 | 2023-01-17 13:28:06 +0100 | [diff] [blame] | 27 | */ |
Gabor Mezei | aaa1d2a | 2023-01-23 16:13:43 +0100 | [diff] [blame] | 28 | MBEDTLS_STATIC_TESTABLE |
Gabor Mezei | 9073f7d | 2023-01-23 19:05:37 +0100 | [diff] [blame] | 29 | void mbedtls_mpi_mod_raw_fix_quasi_reduction(mbedtls_mpi_uint *X, |
| 30 | const mbedtls_mpi_mod_modulus *N); |
Gabor Mezei | 9684d4d | 2023-01-16 16:50:11 +0100 | [diff] [blame] | 31 | |
Gabor Mezei | e81a2b8 | 2023-01-23 18:56:38 +0100 | [diff] [blame] | 32 | #endif /* MBEDTLS_TEST_HOOKS */ |
| 33 | |
Gabor Mezei | aaa1d2a | 2023-01-23 16:13:43 +0100 | [diff] [blame] | 34 | #endif /* MBEDTLS_BIGNUM_MOD_RAW_INVASIVE_H */ |