bignum_mod_raw_invasive.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /**
  2. * \file bignum_mod_raw_invasive.h
  3. *
  4. * \brief Function declarations for invasive functions of Low-level
  5. * modular bignum.
  6. */
  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. #ifndef MBEDTLS_BIGNUM_MOD_RAW_INVASIVE_H
  24. #define MBEDTLS_BIGNUM_MOD_RAW_INVASIVE_H
  25. #include "common.h"
  26. #include "mbedtls/bignum.h"
  27. #include "bignum_mod.h"
  28. #if defined(MBEDTLS_TEST_HOOKS)
  29. /** Convert the result of a quasi-reduction to its canonical representative.
  30. *
  31. * \param[in,out] X The address of the MPI to be converted. Must have the
  32. * same number of limbs as \p N. The input value must
  33. * be in range 0 <= X < 2N.
  34. * \param[in] N The address of the modulus.
  35. */
  36. MBEDTLS_STATIC_TESTABLE
  37. void mbedtls_mpi_mod_raw_fix_quasi_reduction(mbedtls_mpi_uint *X,
  38. const mbedtls_mpi_mod_modulus *N);
  39. #endif /* MBEDTLS_TEST_HOOKS */
  40. #endif /* MBEDTLS_BIGNUM_MOD_RAW_INVASIVE_H */