blob: 2af7510f99882fafc09414f6fd3937e5909420e7 [file] [log] [blame]
Hanno Beckeraef9cc42022-04-11 06:36:29 +01001/**
2 * Internal bignum functions
3 *
4 * Copyright The Mbed TLS Contributors
5 * SPDX-License-Identifier: Apache-2.0
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may
8 * not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19
20#ifndef MBEDTLS_BIGNUM_INTERNAL_H
21#define MBEDTLS_BIGNUM_INTERNAL_H
22
23#include "common.h"
24
25#if defined(MBEDTLS_BIGNUM_C)
26#include "mbedtls/bignum.h"
27#endif
28
29/** Helper for mbedtls_mpi multiplication.
30 *
31 * Add \p b * \p s to \p d.
32 *
33 * \param[in,out] d The bignum to add to.
34 * \param d_len The number of limbs of \p d. This must be
35 * at least \p s_len.
36 * \param s_len The number of limbs of \p s.
37 * \param[in] s A bignum to multiply, of size \p i.
38 * It may overlap with \p d, but only if
39 * \p d <= \p s.
40 * Its leading limb must not be \c 0.
41 * \param b A scalar to multiply.
42 *
43 * \return c The carry at the end of the operation.
44 */
45mbedtls_mpi_uint mbedtls_mpi_core_mla( mbedtls_mpi_uint *d, size_t d_len ,
46 const mbedtls_mpi_uint *s, size_t s_len,
47 mbedtls_mpi_uint b );
48
49#endif /* MBEDTLS_BIGNUM_INTERNAL_H */