v / thirdparty / mbedtls / library / bignum_core_invasive.h
38 lines · 29 sloc · 1.01 KB · 8de6de946e2fb116f77a4e3ad7e167504dacb82f
Raw
1/**
2 * \file bignum_core_invasive.h
3 *
4 * \brief Function declarations for invasive functions of bignum core.
5 */
6/**
7 * Copyright The Mbed TLS Contributors
8 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
9 */
10
11#ifndef MBEDTLS_BIGNUM_CORE_INVASIVE_H
12#define MBEDTLS_BIGNUM_CORE_INVASIVE_H
13
14#include "bignum_core.h"
15
16#if defined(MBEDTLS_TEST_HOOKS)
17
18#if !defined(MBEDTLS_THREADING_C)
19
20extern void (*mbedtls_safe_codepath_hook)(void);
21extern void (*mbedtls_unsafe_codepath_hook)(void);
22
23#endif /* !MBEDTLS_THREADING_C */
24
25/** Divide X by 2 mod N in place, assuming N is odd.
26 *
27 * \param[in,out] X The value to divide by 2 mod \p N.
28 * \param[in] N The modulus. Must be odd.
29 * \param[in] limbs The number of limbs in \p X and \p N.
30 */
31MBEDTLS_STATIC_TESTABLE
32void mbedtls_mpi_core_div2_mod_odd(mbedtls_mpi_uint *X,
33 const mbedtls_mpi_uint *N,
34 size_t limbs);
35
36#endif /* MBEDTLS_TEST_HOOKS */
37
38#endif /* MBEDTLS_BIGNUM_CORE_INVASIVE_H */
39