blob: 94a0d06cf0f86e799b72144b2db3d82278dd2c74 [file] [log] [blame]
Gabor Mezei9684d4d2023-01-16 16:50:11 +01001/**
Gabor Mezeiaaa1d2a2023-01-23 16:13:43 +01002 * \file bignum_mod_raw_invasive.h
Gabor Mezei9684d4d2023-01-16 16:50:11 +01003 *
Gabor Mezeiaaa1d2a2023-01-23 16:13:43 +01004 * \brief Function declarations for invasive functions of Low-level
5 * modular bignum.
Gabor Mezei9684d4d2023-01-16 16:50:11 +01006 */
7/**
8 * Copyright The Mbed TLS Contributors
Dave Rodgman16799db2023-11-02 19:47:20 +00009 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
Gabor Mezei9684d4d2023-01-16 16:50:11 +010010 */
11
Gabor Mezeiaaa1d2a2023-01-23 16:13:43 +010012#ifndef MBEDTLS_BIGNUM_MOD_RAW_INVASIVE_H
13#define MBEDTLS_BIGNUM_MOD_RAW_INVASIVE_H
Gabor Mezei9684d4d2023-01-16 16:50:11 +010014
15#include "common.h"
16#include "mbedtls/bignum.h"
17#include "bignum_mod.h"
18
Gabor Mezeie81a2b82023-01-23 18:56:38 +010019#if defined(MBEDTLS_TEST_HOOKS)
20
Gabor Mezeia24fd062023-01-23 19:10:26 +010021/** Convert the result of a quasi-reduction to its canonical representative.
Gabor Mezeic83f7922023-01-17 13:28:06 +010022 *
23 * \param[in,out] X The address of the MPI to be converted. Must have the
Gabor Mezeia24fd062023-01-23 19:10:26 +010024 * same number of limbs as \p N. The input value must
25 * be in range 0 <= X < 2N.
Gabor Mezeic83f7922023-01-17 13:28:06 +010026 * \param[in] N The address of the modulus.
Gabor Mezeic83f7922023-01-17 13:28:06 +010027 */
Gabor Mezeiaaa1d2a2023-01-23 16:13:43 +010028MBEDTLS_STATIC_TESTABLE
Gabor Mezei9073f7d2023-01-23 19:05:37 +010029void mbedtls_mpi_mod_raw_fix_quasi_reduction(mbedtls_mpi_uint *X,
30 const mbedtls_mpi_mod_modulus *N);
Gabor Mezei9684d4d2023-01-16 16:50:11 +010031
Gabor Mezeie81a2b82023-01-23 18:56:38 +010032#endif /* MBEDTLS_TEST_HOOKS */
33
Gabor Mezeiaaa1d2a2023-01-23 16:13:43 +010034#endif /* MBEDTLS_BIGNUM_MOD_RAW_INVASIVE_H */