blob: ead83942c6059903ab18b3e5c436bb3126de5661 [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
9 * SPDX-License-Identifier: Apache-2.0
10 *
11 * Licensed under the Apache License, Version 2.0 (the "License"); you may
12 * not use this file except in compliance with the License.
13 * You may obtain a copy of the License at
14 *
15 * http://www.apache.org/licenses/LICENSE-2.0
16 *
17 * Unless required by applicable law or agreed to in writing, software
18 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
19 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 * See the License for the specific language governing permissions and
21 * limitations under the License.
22 */
23
Gabor Mezeiaaa1d2a2023-01-23 16:13:43 +010024#ifndef MBEDTLS_BIGNUM_MOD_RAW_INVASIVE_H
25#define MBEDTLS_BIGNUM_MOD_RAW_INVASIVE_H
Gabor Mezei9684d4d2023-01-16 16:50:11 +010026
27#include "common.h"
28#include "mbedtls/bignum.h"
29#include "bignum_mod.h"
30
Gabor Mezeie81a2b82023-01-23 18:56:38 +010031#if defined(MBEDTLS_TEST_HOOKS)
32
Gabor Mezeia24fd062023-01-23 19:10:26 +010033/** Convert the result of a quasi-reduction to its canonical representative.
Gabor Mezeic83f7922023-01-17 13:28:06 +010034 *
35 * \param[in,out] X The address of the MPI to be converted. Must have the
Gabor Mezeia24fd062023-01-23 19:10:26 +010036 * same number of limbs as \p N. The input value must
37 * be in range 0 <= X < 2N.
Gabor Mezeic83f7922023-01-17 13:28:06 +010038 * \param[in] N The address of the modulus.
Gabor Mezeic83f7922023-01-17 13:28:06 +010039 */
Gabor Mezeiaaa1d2a2023-01-23 16:13:43 +010040MBEDTLS_STATIC_TESTABLE
Gabor Mezei9073f7d2023-01-23 19:05:37 +010041void mbedtls_mpi_mod_raw_fix_quasi_reduction(mbedtls_mpi_uint *X,
42 const mbedtls_mpi_mod_modulus *N);
Gabor Mezei9684d4d2023-01-16 16:50:11 +010043
Gabor Mezeie81a2b82023-01-23 18:56:38 +010044#endif /* MBEDTLS_TEST_HOOKS */
45
Gabor Mezeiaaa1d2a2023-01-23 16:13:43 +010046#endif /* MBEDTLS_BIGNUM_MOD_RAW_INVASIVE_H */