blob: 2274a8a9045f3295f62ae8da4a876b9ab969c661 [file] [log] [blame]
Gabor Mezeib9030702022-07-18 23:09:45 +02001/**
Janos Follath63184682022-08-11 17:42:59 +01002 * Core bignum functions
3 *
Janos Follathaf3f39c2022-08-22 09:06:32 +01004 * This interface should only be used by the legacy bignum module (bignum.h)
Janos Follath63184682022-08-11 17:42:59 +01005 * and the modular bignum modules (bignum_mod.c, bignum_mod_raw.c). All other
Janos Follathaf3f39c2022-08-22 09:06:32 +01006 * modules should use the high-level modular bignum interface (bignum_mod.h)
Janos Follath63184682022-08-11 17:42:59 +01007 * or the legacy bignum interface (bignum.h).
Gabor Mezeib9030702022-07-18 23:09:45 +02008 *
Gilles Peskine7aab2fb2022-09-27 13:19:13 +02009 * This module is about processing non-negative integers with a fixed upper
10 * bound that's of the form 2^#biL-1. Many operations treat these numbers
11 * as the principal representation of a number modulo 2^#biL or a smaller
12 * bound.
13 *
Gilles Peskine29264842022-09-27 13:19:50 +020014 * The functions in this module obey the following conventions unless
15 * explicitly indicated otherwise:
16 *
17 * - **Overflow**: some functions indicate overflow from the range
18 * [0, 2^#biL-1] by returning carry parameters, while others operate
19 * modulo and so cannot overflow. This should be clear from the function
20 * documentation.
21 * - **Bignum parameters**: Bignums are passed as pointers to an array of
22 * limbs. A limb has the type #mbedtls_mpi_uint. Unless otherwise specified:
23 * - Bignum parameters called \p A, \p B, ... are inputs, and are
24 * not modified by the function.
25 * - For operations modulo some number, the modulus is called \p N
26 * and is input-only.
27 * - Bignum parameters called \p X, \p Y are outputs or input-output.
28 * The initial content of output-only parameters is ignored.
29 * - Some functions use different names that reflect traditional
30 * naming of operands of certain operations (e.g.
31 * divisor/dividend/quotient/remainder).
32 * - \p T is a temporary storage area. The initial content of such
33 * parameter is ignored and the final content is unspecified.
34 * - **Bignum sizes**: bignum sizes are always expressed in limbs.
35 * Most functions work on bignums of a given size and take a single
36 * \p limbs parameter that applies to all parameters that are limb arrays.
37 * All bignum sizes must be at least 1 and must be significantly less than
38 * #SIZE_MAX. The behavior if a size is 0 is undefined. The behavior if the
39 * total size of all parameters overflows #SIZE_MAX is undefined.
40 * - **Parameter ordering**: for bignum parameters, outputs come before inputs.
41 * Temporaries come last.
42 * - **Aliasing**: in general, output bignums may be aliased to one or more
43 * inputs. As an exception, parameters that are documented as a modulus value
44 * may not be aliased to an output. Temporaries may not be aliased to
45 * any other parameter.
46 * - **Overlap**: apart from aliasing of limb array pointers (where two
47 * arguments are equal pointers), overlap is not supported and may result
48 * in undefined behavior.
49 * - **Error handling**: This is a low-level module. Functions generally do not
50 * try to protect against invalid arguments such as nonsensical sizes or
51 * null pointers. Note that some functions that operate on bignums of
52 * different sizes have constraints about their size, and violating those
53 * constraints may lead to buffer overflows.
54 * - **Modular representatives**: functions that operate modulo \p N expect
55 * all modular inputs to be in the range [0, \p N - 1] and guarantee outputs
56 * in the range [0, \p N - 1]. If an input is out of range, outputs are
57 * fully unspecified, though bignum values out of range should not cause
58 * buffer overflows (beware that this is not extensively tested).
Gilles Peskine7f887bd2022-09-27 13:12:30 +020059 */
60
61/*
Gabor Mezeib9030702022-07-18 23:09:45 +020062 * Copyright The Mbed TLS Contributors
63 * SPDX-License-Identifier: Apache-2.0
64 *
65 * Licensed under the Apache License, Version 2.0 (the "License"); you may
66 * not use this file except in compliance with the License.
67 * You may obtain a copy of the License at
68 *
69 * http://www.apache.org/licenses/LICENSE-2.0
70 *
71 * Unless required by applicable law or agreed to in writing, software
72 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
73 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
74 * See the License for the specific language governing permissions and
75 * limitations under the License.
76 */
77
78#ifndef MBEDTLS_BIGNUM_CORE_H
79#define MBEDTLS_BIGNUM_CORE_H
80
81#include "common.h"
82
83#if defined(MBEDTLS_BIGNUM_C)
84#include "mbedtls/bignum.h"
85#endif
86
Gilles Peskine29264842022-09-27 13:19:50 +020087#define ciL ( sizeof(mbedtls_mpi_uint) ) /** chars in limb */
88#define biL ( ciL << 3 ) /** bits in limb */
89#define biH ( ciL << 2 ) /** half limb size */
Tom Cosgrove5eefc3d2022-08-31 17:16:50 +010090
91/*
92 * Convert between bits/chars and number of limbs
93 * Divide first in order to avoid potential overflows
94 */
95#define BITS_TO_LIMBS(i) ( (i) / biL + ( (i) % biL != 0 ) )
96#define CHARS_TO_LIMBS(i) ( (i) / ciL + ( (i) % ciL != 0 ) )
97/* Get a specific byte, without range checks. */
98#define GET_BYTE( X, i ) \
99 ( ( (X)[(i) / ciL] >> ( ( (i) % ciL ) * 8 ) ) & 0xff )
100
Gabor Mezei37b06362022-08-02 17:22:18 +0200101/** Count leading zero bits in a given integer.
102 *
Janos Follathb7a88ec2022-08-19 12:24:40 +0100103 * \param a Integer to count leading zero bits.
Gabor Mezei37b06362022-08-02 17:22:18 +0200104 *
Janos Follathb7a88ec2022-08-19 12:24:40 +0100105 * \return The number of leading zero bits in \p a.
Gabor Mezei37b06362022-08-02 17:22:18 +0200106 */
Janos Follath2e328c82022-08-22 11:19:10 +0100107size_t mbedtls_mpi_core_clz( mbedtls_mpi_uint a );
Janos Follath4670f882022-07-21 18:25:42 +0100108
Janos Follatha95f2042022-08-19 12:09:17 +0100109/** Return the minimum number of bits required to represent the value held
Janos Follath63184682022-08-11 17:42:59 +0100110 * in the MPI.
111 *
Janos Follathb7a88ec2022-08-19 12:24:40 +0100112 * \note This function returns 0 if all the limbs of \p A are 0.
Gabor Mezei37b06362022-08-02 17:22:18 +0200113 *
Janos Follathb7a88ec2022-08-19 12:24:40 +0100114 * \param[in] A The address of the MPI.
Janos Follathc4596412022-08-22 10:01:27 +0100115 * \param A_limbs The number of limbs of \p A.
Gabor Mezei37b06362022-08-02 17:22:18 +0200116 *
Janos Follathb7a88ec2022-08-19 12:24:40 +0100117 * \return The number of bits in \p A.
Gabor Mezei37b06362022-08-02 17:22:18 +0200118 */
Janos Follathaf3f39c2022-08-22 09:06:32 +0100119size_t mbedtls_mpi_core_bitlen( const mbedtls_mpi_uint *A, size_t A_limbs );
Janos Follath4670f882022-07-21 18:25:42 +0100120
Gabor Mezei37b06362022-08-02 17:22:18 +0200121/** Convert a big-endian byte array aligned to the size of mbedtls_mpi_uint
122 * into the storage form used by mbedtls_mpi.
123 *
Janos Follathb7a88ec2022-08-19 12:24:40 +0100124 * \param[in,out] A The address of the MPI.
Janos Follathc4596412022-08-22 10:01:27 +0100125 * \param A_limbs The number of limbs of \p A.
Gabor Mezei37b06362022-08-02 17:22:18 +0200126 */
Janos Follathb7a88ec2022-08-19 12:24:40 +0100127void mbedtls_mpi_core_bigendian_to_host( mbedtls_mpi_uint *A,
Janos Follathc4596412022-08-22 10:01:27 +0100128 size_t A_limbs );
Janos Follath4670f882022-07-21 18:25:42 +0100129
Janos Follathaf3f39c2022-08-22 09:06:32 +0100130/** Import X from unsigned binary data, little-endian.
Gabor Mezei37b06362022-08-02 17:22:18 +0200131 *
Janos Follath63184682022-08-11 17:42:59 +0100132 * The MPI needs to have enough limbs to store the full value (including any
133 * most significant zero bytes in the input).
Gabor Mezei37b06362022-08-02 17:22:18 +0200134 *
Janos Follathb7a88ec2022-08-19 12:24:40 +0100135 * \param[out] X The address of the MPI.
136 * \param X_limbs The number of limbs of \p X.
137 * \param[in] input The input buffer to import from.
138 * \param input_length The length bytes of \p input.
Gabor Mezei37b06362022-08-02 17:22:18 +0200139 *
140 * \return \c 0 if successful.
141 * \return #MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if \p X isn't
Janos Follathb7a88ec2022-08-19 12:24:40 +0100142 * large enough to hold the value in \p input.
Gabor Mezei37b06362022-08-02 17:22:18 +0200143 */
Gabor Mezeib9030702022-07-18 23:09:45 +0200144int mbedtls_mpi_core_read_le( mbedtls_mpi_uint *X,
Janos Follathb7a88ec2022-08-19 12:24:40 +0100145 size_t X_limbs,
146 const unsigned char *input,
147 size_t input_length );
Gabor Mezeib9030702022-07-18 23:09:45 +0200148
Janos Follathaf3f39c2022-08-22 09:06:32 +0100149/** Import X from unsigned binary data, big-endian.
Gabor Mezei37b06362022-08-02 17:22:18 +0200150 *
Janos Follath63184682022-08-11 17:42:59 +0100151 * The MPI needs to have enough limbs to store the full value (including any
152 * most significant zero bytes in the input).
Gabor Mezei37b06362022-08-02 17:22:18 +0200153 *
Janos Follathb7a88ec2022-08-19 12:24:40 +0100154 * \param[out] X The address of the MPI.
155 * May only be #NULL if \X_limbs is 0 and \p input_length
156 * is 0.
157 * \param X_limbs The number of limbs of \p X.
158 * \param[in] input The input buffer to import from.
159 * May only be #NULL if \p input_length is 0.
160 * \param input_length The length in bytes of \p input.
Gabor Mezei37b06362022-08-02 17:22:18 +0200161 *
162 * \return \c 0 if successful.
163 * \return #MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if \p X isn't
Janos Follathb7a88ec2022-08-19 12:24:40 +0100164 * large enough to hold the value in \p input.
Gabor Mezei37b06362022-08-02 17:22:18 +0200165 */
Gabor Mezeib9030702022-07-18 23:09:45 +0200166int mbedtls_mpi_core_read_be( mbedtls_mpi_uint *X,
Janos Follathb7a88ec2022-08-19 12:24:40 +0100167 size_t X_limbs,
168 const unsigned char *input,
169 size_t input_length );
Gabor Mezeib9030702022-07-18 23:09:45 +0200170
Janos Follathaf3f39c2022-08-22 09:06:32 +0100171/** Export A into unsigned binary data, little-endian.
Gabor Mezei37b06362022-08-02 17:22:18 +0200172 *
Janos Follathb7a88ec2022-08-19 12:24:40 +0100173 * \note If \p output is shorter than \p A the export is still successful if the
174 * value held in \p A fits in the buffer (that is, if enough of the most
175 * significant bytes of \p A are 0).
Janos Follath63184682022-08-11 17:42:59 +0100176 *
Janos Follathb7a88ec2022-08-19 12:24:40 +0100177 * \param[in] A The address of the MPI.
178 * \param A_limbs The number of limbs of \p A.
179 * \param[out] output The output buffer to export to.
180 * \param output_length The length in bytes of \p output.
Gabor Mezei37b06362022-08-02 17:22:18 +0200181 *
182 * \return \c 0 if successful.
Janos Follathb7a88ec2022-08-19 12:24:40 +0100183 * \return #MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if \p output isn't
184 * large enough to hold the value of \p A.
Gabor Mezei37b06362022-08-02 17:22:18 +0200185 */
Janos Follathb7a88ec2022-08-19 12:24:40 +0100186int mbedtls_mpi_core_write_le( const mbedtls_mpi_uint *A,
187 size_t A_limbs,
188 unsigned char *output,
189 size_t output_length );
Gabor Mezeib9030702022-07-18 23:09:45 +0200190
Janos Follathaf3f39c2022-08-22 09:06:32 +0100191/** Export A into unsigned binary data, big-endian.
Gabor Mezei37b06362022-08-02 17:22:18 +0200192 *
Janos Follathb7a88ec2022-08-19 12:24:40 +0100193 * \note If \p output is shorter than \p A the export is still successful if the
194 * value held in \p A fits in the buffer (that is, if enough of the most
195 * significant bytes of \p A are 0).
Janos Follath63184682022-08-11 17:42:59 +0100196 *
Janos Follathb7a88ec2022-08-19 12:24:40 +0100197 * \param[in] A The address of the MPI.
198 * \param A_limbs The number of limbs of \p A.
199 * \param[out] output The output buffer to export to.
200 * \param output_length The length in bytes of \p output.
Gabor Mezei37b06362022-08-02 17:22:18 +0200201 *
202 * \return \c 0 if successful.
Janos Follathb7a88ec2022-08-19 12:24:40 +0100203 * \return #MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if \p output isn't
204 * large enough to hold the value of \p A.
Gabor Mezei37b06362022-08-02 17:22:18 +0200205 */
Janos Follathb7a88ec2022-08-19 12:24:40 +0100206int mbedtls_mpi_core_write_be( const mbedtls_mpi_uint *A,
207 size_t A_limbs,
208 unsigned char *output,
209 size_t output_length );
Gabor Mezeib9030702022-07-18 23:09:45 +0200210
Tom Cosgrove90c426b2022-08-23 16:15:19 +0100211/**
Tom Cosgrove5c0e8102022-09-15 15:46:10 +0100212 * \brief Conditional addition of two fixed-size large unsigned integers,
Tom Cosgroved932de82022-08-25 16:43:43 +0100213 * returning the carry.
Hanno Becker71f4b0d2022-08-23 12:09:35 +0100214 *
215 * Functionally equivalent to
216 *
217 * ```
218 * if( cond )
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100219 * X += A;
Hanno Becker71f4b0d2022-08-23 12:09:35 +0100220 * return carry;
221 * ```
222 *
Tom Cosgrove47828232022-09-20 13:51:50 +0100223 * This function operates modulo `2^(biL*limbs)`.
224 *
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100225 * \param[in,out] X The pointer to the (little-endian) array
Tom Cosgrove72594632022-08-24 11:51:58 +0100226 * representing the bignum to accumulate onto.
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100227 * \param[in] A The pointer to the (little-endian) array
Tom Cosgrove72594632022-08-24 11:51:58 +0100228 * representing the bignum to conditionally add
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100229 * to \p X. This may be aliased to \p X but may not
Tom Cosgroveed43c6c2022-08-31 11:35:00 +0100230 * overlap otherwise.
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100231 * \param limbs Number of limbs of \p X and \p A.
Tom Cosgrove72594632022-08-24 11:51:58 +0100232 * \param cond Condition bit dictating whether addition should
233 * happen or not. This must be \c 0 or \c 1.
Hanno Becker71f4b0d2022-08-23 12:09:35 +0100234 *
Tom Cosgroveecbb1242022-08-25 10:13:44 +0100235 * \warning If \p cond is neither 0 nor 1, the result of this function
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100236 * is unspecified, and the resulting value in \p X might be
237 * neither its original value nor \p X + \p A.
Tom Cosgrove72594632022-08-24 11:51:58 +0100238 *
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100239 * \return 1 if `X + cond * A >= 2^(biL*limbs)`, 0 otherwise.
Hanno Becker71f4b0d2022-08-23 12:09:35 +0100240 */
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100241mbedtls_mpi_uint mbedtls_mpi_core_add_if( mbedtls_mpi_uint *X,
242 const mbedtls_mpi_uint *A,
Tom Cosgrove72594632022-08-24 11:51:58 +0100243 size_t limbs,
Tom Cosgrove90c426b2022-08-23 16:15:19 +0100244 unsigned cond );
Hanno Becker71f4b0d2022-08-23 12:09:35 +0100245
Tom Cosgroveb4964862022-08-30 11:57:22 +0100246/**
Tom Cosgrove5c0e8102022-09-15 15:46:10 +0100247 * \brief Subtract two fixed-size large unsigned integers, returning the borrow.
Tom Cosgroveb4964862022-08-30 11:57:22 +0100248 *
Tom Cosgrove5dd97e62022-08-30 14:31:49 +0100249 * Calculate `A - B` where \p A and \p B have the same size.
Tom Cosgrove630110a2022-08-31 17:09:29 +0100250 * This function operates modulo `2^(biL*limbs)` and returns the carry
Tom Cosgroveb4964862022-08-30 11:57:22 +0100251 * (1 if there was a wraparound, i.e. if `A < B`, and 0 otherwise).
252 *
Tom Cosgrove5dd97e62022-08-30 14:31:49 +0100253 * \p X may be aliased to \p A or \p B, or even both, but may not overlap
254 * either otherwise.
Tom Cosgroveb4964862022-08-30 11:57:22 +0100255 *
256 * \param[out] X The result of the subtraction.
257 * \param[in] A Little-endian presentation of left operand.
258 * \param[in] B Little-endian presentation of right operand.
259 * \param limbs Number of limbs of \p X, \p A and \p B.
260 *
261 * \return 1 if `A < B`.
262 * 0 if `A >= B`.
263 */
264mbedtls_mpi_uint mbedtls_mpi_core_sub( mbedtls_mpi_uint *X,
265 const mbedtls_mpi_uint *A,
266 const mbedtls_mpi_uint *B,
267 size_t limbs );
268
269/**
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100270 * \brief Perform a fixed-size multiply accumulate operation: X += b * A
Tom Cosgroveb4964862022-08-30 11:57:22 +0100271 *
Tom Cosgroveb0b77e12022-09-20 13:33:40 +0100272 * \p X may be aliased to \p A (when \p X_limbs == \p A_limbs), but may not
273 * otherwise overlap.
274 *
Tom Cosgrove47828232022-09-20 13:51:50 +0100275 * This function operates modulo `2^(biL*X_limbs)`.
276 *
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100277 * \param[in,out] X The pointer to the (little-endian) array
Tom Cosgroveb4964862022-08-30 11:57:22 +0100278 * representing the bignum to accumulate onto.
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100279 * \param X_limbs The number of limbs of \p X. This must be
280 * at least \p A_limbs.
281 * \param[in] A The pointer to the (little-endian) array
Tom Cosgroveb4964862022-08-30 11:57:22 +0100282 * representing the bignum to multiply with.
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100283 * This may be aliased to \p X but may not overlap
Tom Cosgroveed43c6c2022-08-31 11:35:00 +0100284 * otherwise.
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100285 * \param A_limbs The number of limbs of \p A.
286 * \param b X scalar to multiply with.
Tom Cosgroveb4964862022-08-30 11:57:22 +0100287 *
288 * \return The carry at the end of the operation.
289 */
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100290mbedtls_mpi_uint mbedtls_mpi_core_mla( mbedtls_mpi_uint *X, size_t X_limbs,
291 const mbedtls_mpi_uint *A, size_t A_limbs,
292 mbedtls_mpi_uint b );
Tom Cosgroveb4964862022-08-30 11:57:22 +0100293
294/**
295 * \brief Calculate initialisation value for fast Montgomery modular
296 * multiplication
297 *
298 * \param[in] N Little-endian presentation of the modulus. This must have
299 * at least one limb.
300 *
301 * \return The initialisation value for fast Montgomery modular multiplication
302 */
Tom Cosgroveb7438d12022-09-15 15:05:59 +0100303mbedtls_mpi_uint mbedtls_mpi_core_montmul_init( const mbedtls_mpi_uint *N );
Tom Cosgroveb4964862022-08-30 11:57:22 +0100304
305/**
Tom Cosgrove4386ead2022-09-29 14:40:21 +0100306 * \brief Montgomery multiplication: X = A * B * R^-1 mod N (HAC 14.36)
307 *
308 * \p A and \p B must be in canonical form. That is, < \p N.
Tom Cosgroveb4964862022-08-30 11:57:22 +0100309 *
Tom Cosgroveea45c1d2022-09-20 13:17:51 +0100310 * \p X may be aliased to \p A or \p N, or even \p B (if \p AN_limbs ==
311 * \p B_limbs) but may not overlap any parameters otherwise.
312 *
Tom Cosgrove4386ead2022-09-29 14:40:21 +0100313 * \p A and \p B may alias each other, if \p AN_limbs == \p B_limbs. They may
314 * not alias \p N (since they must be in canonical form, they cannot == \p N).
Tom Cosgroveea45c1d2022-09-20 13:17:51 +0100315 *
Tom Cosgroveb4964862022-08-30 11:57:22 +0100316 * \param[out] X The destination MPI, as a little-endian array of
317 * length \p AN_limbs.
318 * On successful completion, X contains the result of
Tom Cosgrove630110a2022-08-31 17:09:29 +0100319 * the multiplication `A * B * R^-1` mod N where
320 * `R = 2^(biL*AN_limbs)`.
Tom Cosgroveb4964862022-08-30 11:57:22 +0100321 * \param[in] A Little-endian presentation of first operand.
Tom Cosgrove5dd97e62022-08-30 14:31:49 +0100322 * Must have the same number of limbs as \p N.
Tom Cosgroveb4964862022-08-30 11:57:22 +0100323 * \param[in] B Little-endian presentation of second operand.
324 * \param[in] B_limbs The number of limbs in \p B.
Tom Cosgrove5dd97e62022-08-30 14:31:49 +0100325 * Must be <= \p AN_limbs.
Tom Cosgroveb4964862022-08-30 11:57:22 +0100326 * \param[in] N Little-endian presentation of the modulus.
Tom Cosgrove5dd97e62022-08-30 14:31:49 +0100327 * This must be odd, and have exactly the same number
328 * of limbs as \p A.
Tom Cosgrove6da3a3b2022-09-29 17:20:18 +0100329 * It may alias \p X, but must not alias or otherwise
330 * overlap any of the other parameters.
Tom Cosgrove5dd97e62022-08-30 14:31:49 +0100331 * \param[in] AN_limbs The number of limbs in \p X, \p A and \p N.
Tom Cosgrove630110a2022-08-31 17:09:29 +0100332 * \param mm The Montgomery constant for \p N: -N^-1 mod 2^biL.
Tom Cosgroveb7438d12022-09-15 15:05:59 +0100333 * This can be calculated by `mbedtls_mpi_core_montmul_init()`.
Tom Cosgroveb4964862022-08-30 11:57:22 +0100334 * \param[in,out] T Temporary storage of size at least 2*AN_limbs+1 limbs.
335 * Its initial content is unused and
336 * its final content is indeterminate.
Tom Cosgrove4386ead2022-09-29 14:40:21 +0100337 * It must not alias or otherwise overlap any of the
338 * other parameters.
Tom Cosgroveb4964862022-08-30 11:57:22 +0100339 */
340void mbedtls_mpi_core_montmul( mbedtls_mpi_uint *X,
341 const mbedtls_mpi_uint *A,
342 const mbedtls_mpi_uint *B, size_t B_limbs,
343 const mbedtls_mpi_uint *N, size_t AN_limbs,
344 mbedtls_mpi_uint mm, mbedtls_mpi_uint *T );
345
Gabor Mezeib9030702022-07-18 23:09:45 +0200346#endif /* MBEDTLS_BIGNUM_CORE_H */