blob: 24650fe4c8ec15b48d27bb2695707618d2770a7f [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 *
9 * Copyright The Mbed TLS Contributors
10 * SPDX-License-Identifier: Apache-2.0
11 *
12 * Licensed under the Apache License, Version 2.0 (the "License"); you may
13 * not use this file except in compliance with the License.
14 * You may obtain a copy of the License at
15 *
16 * http://www.apache.org/licenses/LICENSE-2.0
17 *
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
20 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
23 */
24
25#ifndef MBEDTLS_BIGNUM_CORE_H
26#define MBEDTLS_BIGNUM_CORE_H
27
28#include "common.h"
29
30#if defined(MBEDTLS_BIGNUM_C)
31#include "mbedtls/bignum.h"
32#endif
33
Tom Cosgrove5eefc3d2022-08-31 17:16:50 +010034#define ciL ( sizeof(mbedtls_mpi_uint) ) /* chars in limb */
35#define biL ( ciL << 3 ) /* bits in limb */
36#define biH ( ciL << 2 ) /* half limb size */
37
38/*
39 * Convert between bits/chars and number of limbs
40 * Divide first in order to avoid potential overflows
41 */
42#define BITS_TO_LIMBS(i) ( (i) / biL + ( (i) % biL != 0 ) )
43#define CHARS_TO_LIMBS(i) ( (i) / ciL + ( (i) % ciL != 0 ) )
44/* Get a specific byte, without range checks. */
45#define GET_BYTE( X, i ) \
46 ( ( (X)[(i) / ciL] >> ( ( (i) % ciL ) * 8 ) ) & 0xff )
47
Gabor Mezei37b06362022-08-02 17:22:18 +020048/** Count leading zero bits in a given integer.
49 *
Janos Follathb7a88ec2022-08-19 12:24:40 +010050 * \param a Integer to count leading zero bits.
Gabor Mezei37b06362022-08-02 17:22:18 +020051 *
Janos Follathb7a88ec2022-08-19 12:24:40 +010052 * \return The number of leading zero bits in \p a.
Gabor Mezei37b06362022-08-02 17:22:18 +020053 */
Janos Follath2e328c82022-08-22 11:19:10 +010054size_t mbedtls_mpi_core_clz( mbedtls_mpi_uint a );
Janos Follath4670f882022-07-21 18:25:42 +010055
Janos Follatha95f2042022-08-19 12:09:17 +010056/** Return the minimum number of bits required to represent the value held
Janos Follath63184682022-08-11 17:42:59 +010057 * in the MPI.
58 *
Janos Follathb7a88ec2022-08-19 12:24:40 +010059 * \note This function returns 0 if all the limbs of \p A are 0.
Gabor Mezei37b06362022-08-02 17:22:18 +020060 *
Janos Follathb7a88ec2022-08-19 12:24:40 +010061 * \param[in] A The address of the MPI.
Janos Follathc4596412022-08-22 10:01:27 +010062 * \param A_limbs The number of limbs of \p A.
Gabor Mezei37b06362022-08-02 17:22:18 +020063 *
Janos Follathb7a88ec2022-08-19 12:24:40 +010064 * \return The number of bits in \p A.
Gabor Mezei37b06362022-08-02 17:22:18 +020065 */
Janos Follathaf3f39c2022-08-22 09:06:32 +010066size_t mbedtls_mpi_core_bitlen( const mbedtls_mpi_uint *A, size_t A_limbs );
Janos Follath4670f882022-07-21 18:25:42 +010067
Gabor Mezei37b06362022-08-02 17:22:18 +020068/** Convert a big-endian byte array aligned to the size of mbedtls_mpi_uint
69 * into the storage form used by mbedtls_mpi.
70 *
Janos Follathb7a88ec2022-08-19 12:24:40 +010071 * \param[in,out] A The address of the MPI.
Janos Follathc4596412022-08-22 10:01:27 +010072 * \param A_limbs The number of limbs of \p A.
Gabor Mezei37b06362022-08-02 17:22:18 +020073 */
Janos Follathb7a88ec2022-08-19 12:24:40 +010074void mbedtls_mpi_core_bigendian_to_host( mbedtls_mpi_uint *A,
Janos Follathc4596412022-08-22 10:01:27 +010075 size_t A_limbs );
Janos Follath4670f882022-07-21 18:25:42 +010076
Gabor Mezeie1d31c42022-09-12 16:25:24 +020077/**
78 * \brief Perform a safe conditional copy of MPI which doesn't reveal whether
79 * the condition was true or not.
80 *
81 * \param[OUT] X The address of the first MPI. This must be initialized.
82 * \param X_limbs The number of limbs of \p X.
83 * \param[IN] Y The address of the second MPI. This must be initialized.
84 * \param Y_limbs The number of limbs of \p Y.
85 * \param assign The condition deciding whether to perform the
86 * assignment or not. Must be either 0 or 1:
87 * * \c 1: Perform the assignment `X = Y`.
88 * * \c 0: Keep the original value of \p X.
89 *
90 * \note This function avoids leaking any information about whether
91 * the assignment was done or not.
92 *
93 * \warning If \p assign is neither 0 nor 1, the result of this function
94 * is indeterminate, and the resulting value in \p X might be
95 * neither its original value nor the value in \p Y.
96 *
97 * \return \c 0 if successful.
98 * \return #MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if \p X isn't
99 * large enough to hold the value in \p Y.
100 * \return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if \p X or \p Y is invalid.
101 */
102int mbedtls_mpi_core_cond_assign( mbedtls_mpi_uint *X,
103 size_t X_limbs,
104 const mbedtls_mpi_uint *Y,
105 size_t Y_limbs,
106 unsigned char assign );
107
108/**
109 * \brief Perform a safe conditional copy of MPI which doesn't reveal whether
110 * the condition was true or not.
111 *
112 * \param[IN,OUT] X The address of the first MPI.
113 * This must be initialized.
114 * \param X_limbs The number of limbs of \p X.
115 * \param[IN,OUT] Y The address of the second MPI.
116 * This must be initialized.
117 * \param Y_limbs The number of limbs of \p Y.
118 * \param swap The condition deciding whether to perform
119 * the swap or not. Must be either 0 or 1:
120 * * \c 1: Swap the values of \p X and \p Y.
121 * * \c 0: Keep the original values of \p X and \p Y.
122 *
123 * \note This function avoids leaking any information about whether
124 * the swap was done or not.
125 *
126 * \warning If \p swap is neither 0 nor 1, the result of this function
127 * is indeterminate, and both \p X and \p Y might end up with
128 * values different to either of the original ones.
129 *
130 * \return \c 0 if successful.
131 * \return #MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if the size of
132 * \p X and \p Y is differ.
133 * \return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if \p X or \p Y is invalid.
134 */
135int mbedtls_mpi_core_cond_swap( mbedtls_mpi_uint *X,
136 size_t X_limbs,
137 mbedtls_mpi_uint *Y,
138 size_t Y_limbs,
139 unsigned char swap );
140
Janos Follathaf3f39c2022-08-22 09:06:32 +0100141/** Import X from unsigned binary data, little-endian.
Gabor Mezei37b06362022-08-02 17:22:18 +0200142 *
Janos Follath63184682022-08-11 17:42:59 +0100143 * The MPI needs to have enough limbs to store the full value (including any
144 * most significant zero bytes in the input).
Gabor Mezei37b06362022-08-02 17:22:18 +0200145 *
Janos Follathb7a88ec2022-08-19 12:24:40 +0100146 * \param[out] X The address of the MPI.
147 * \param X_limbs The number of limbs of \p X.
148 * \param[in] input The input buffer to import from.
149 * \param input_length The length bytes of \p input.
Gabor Mezei37b06362022-08-02 17:22:18 +0200150 *
151 * \return \c 0 if successful.
152 * \return #MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if \p X isn't
Janos Follathb7a88ec2022-08-19 12:24:40 +0100153 * large enough to hold the value in \p input.
Gabor Mezei37b06362022-08-02 17:22:18 +0200154 */
Gabor Mezeib9030702022-07-18 23:09:45 +0200155int mbedtls_mpi_core_read_le( mbedtls_mpi_uint *X,
Janos Follathb7a88ec2022-08-19 12:24:40 +0100156 size_t X_limbs,
157 const unsigned char *input,
158 size_t input_length );
Gabor Mezeib9030702022-07-18 23:09:45 +0200159
Janos Follathaf3f39c2022-08-22 09:06:32 +0100160/** Import X from unsigned binary data, big-endian.
Gabor Mezei37b06362022-08-02 17:22:18 +0200161 *
Janos Follath63184682022-08-11 17:42:59 +0100162 * The MPI needs to have enough limbs to store the full value (including any
163 * most significant zero bytes in the input).
Gabor Mezei37b06362022-08-02 17:22:18 +0200164 *
Janos Follathb7a88ec2022-08-19 12:24:40 +0100165 * \param[out] X The address of the MPI.
166 * May only be #NULL if \X_limbs is 0 and \p input_length
167 * is 0.
168 * \param X_limbs The number of limbs of \p X.
169 * \param[in] input The input buffer to import from.
170 * May only be #NULL if \p input_length is 0.
171 * \param input_length The length in bytes of \p input.
Gabor Mezei37b06362022-08-02 17:22:18 +0200172 *
173 * \return \c 0 if successful.
174 * \return #MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if \p X isn't
Janos Follathb7a88ec2022-08-19 12:24:40 +0100175 * large enough to hold the value in \p input.
Gabor Mezei37b06362022-08-02 17:22:18 +0200176 */
Gabor Mezeib9030702022-07-18 23:09:45 +0200177int mbedtls_mpi_core_read_be( mbedtls_mpi_uint *X,
Janos Follathb7a88ec2022-08-19 12:24:40 +0100178 size_t X_limbs,
179 const unsigned char *input,
180 size_t input_length );
Gabor Mezeib9030702022-07-18 23:09:45 +0200181
Janos Follathaf3f39c2022-08-22 09:06:32 +0100182/** Export A into unsigned binary data, little-endian.
Gabor Mezei37b06362022-08-02 17:22:18 +0200183 *
Janos Follathb7a88ec2022-08-19 12:24:40 +0100184 * \note If \p output is shorter than \p A the export is still successful if the
185 * value held in \p A fits in the buffer (that is, if enough of the most
186 * significant bytes of \p A are 0).
Janos Follath63184682022-08-11 17:42:59 +0100187 *
Janos Follathb7a88ec2022-08-19 12:24:40 +0100188 * \param[in] A The address of the MPI.
189 * \param A_limbs The number of limbs of \p A.
190 * \param[out] output The output buffer to export to.
191 * \param output_length The length in bytes of \p output.
Gabor Mezei37b06362022-08-02 17:22:18 +0200192 *
193 * \return \c 0 if successful.
Janos Follathb7a88ec2022-08-19 12:24:40 +0100194 * \return #MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if \p output isn't
195 * large enough to hold the value of \p A.
Gabor Mezei37b06362022-08-02 17:22:18 +0200196 */
Janos Follathb7a88ec2022-08-19 12:24:40 +0100197int mbedtls_mpi_core_write_le( const mbedtls_mpi_uint *A,
198 size_t A_limbs,
199 unsigned char *output,
200 size_t output_length );
Gabor Mezeib9030702022-07-18 23:09:45 +0200201
Janos Follathaf3f39c2022-08-22 09:06:32 +0100202/** Export A into unsigned binary data, big-endian.
Gabor Mezei37b06362022-08-02 17:22:18 +0200203 *
Janos Follathb7a88ec2022-08-19 12:24:40 +0100204 * \note If \p output is shorter than \p A the export is still successful if the
205 * value held in \p A fits in the buffer (that is, if enough of the most
206 * significant bytes of \p A are 0).
Janos Follath63184682022-08-11 17:42:59 +0100207 *
Janos Follathb7a88ec2022-08-19 12:24:40 +0100208 * \param[in] A The address of the MPI.
209 * \param A_limbs The number of limbs of \p A.
210 * \param[out] output The output buffer to export to.
211 * \param output_length The length in bytes of \p output.
Gabor Mezei37b06362022-08-02 17:22:18 +0200212 *
213 * \return \c 0 if successful.
Janos Follathb7a88ec2022-08-19 12:24:40 +0100214 * \return #MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if \p output isn't
215 * large enough to hold the value of \p A.
Gabor Mezei37b06362022-08-02 17:22:18 +0200216 */
Janos Follathb7a88ec2022-08-19 12:24:40 +0100217int mbedtls_mpi_core_write_be( const mbedtls_mpi_uint *A,
218 size_t A_limbs,
219 unsigned char *output,
220 size_t output_length );
Gabor Mezeib9030702022-07-18 23:09:45 +0200221
Tom Cosgrove90c426b2022-08-23 16:15:19 +0100222/**
Tom Cosgrove5c0e8102022-09-15 15:46:10 +0100223 * \brief Conditional addition of two fixed-size large unsigned integers,
Tom Cosgroved932de82022-08-25 16:43:43 +0100224 * returning the carry.
Hanno Becker71f4b0d2022-08-23 12:09:35 +0100225 *
226 * Functionally equivalent to
227 *
228 * ```
229 * if( cond )
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100230 * X += A;
Hanno Becker71f4b0d2022-08-23 12:09:35 +0100231 * return carry;
232 * ```
233 *
Tom Cosgrove47828232022-09-20 13:51:50 +0100234 * This function operates modulo `2^(biL*limbs)`.
235 *
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100236 * \param[in,out] X The pointer to the (little-endian) array
Tom Cosgrove72594632022-08-24 11:51:58 +0100237 * representing the bignum to accumulate onto.
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100238 * \param[in] A The pointer to the (little-endian) array
Tom Cosgrove72594632022-08-24 11:51:58 +0100239 * representing the bignum to conditionally add
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100240 * to \p X. This may be aliased to \p X but may not
Tom Cosgroveed43c6c2022-08-31 11:35:00 +0100241 * overlap otherwise.
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100242 * \param limbs Number of limbs of \p X and \p A.
Tom Cosgrove72594632022-08-24 11:51:58 +0100243 * \param cond Condition bit dictating whether addition should
244 * happen or not. This must be \c 0 or \c 1.
Hanno Becker71f4b0d2022-08-23 12:09:35 +0100245 *
Tom Cosgroveecbb1242022-08-25 10:13:44 +0100246 * \warning If \p cond is neither 0 nor 1, the result of this function
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100247 * is unspecified, and the resulting value in \p X might be
248 * neither its original value nor \p X + \p A.
Tom Cosgrove72594632022-08-24 11:51:58 +0100249 *
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100250 * \return 1 if `X + cond * A >= 2^(biL*limbs)`, 0 otherwise.
Hanno Becker71f4b0d2022-08-23 12:09:35 +0100251 */
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100252mbedtls_mpi_uint mbedtls_mpi_core_add_if( mbedtls_mpi_uint *X,
253 const mbedtls_mpi_uint *A,
Tom Cosgrove72594632022-08-24 11:51:58 +0100254 size_t limbs,
Tom Cosgrove90c426b2022-08-23 16:15:19 +0100255 unsigned cond );
Hanno Becker71f4b0d2022-08-23 12:09:35 +0100256
Tom Cosgroveb4964862022-08-30 11:57:22 +0100257/**
Tom Cosgrove5c0e8102022-09-15 15:46:10 +0100258 * \brief Subtract two fixed-size large unsigned integers, returning the borrow.
Tom Cosgroveb4964862022-08-30 11:57:22 +0100259 *
Tom Cosgrove5dd97e62022-08-30 14:31:49 +0100260 * Calculate `A - B` where \p A and \p B have the same size.
Tom Cosgrove630110a2022-08-31 17:09:29 +0100261 * This function operates modulo `2^(biL*limbs)` and returns the carry
Tom Cosgroveb4964862022-08-30 11:57:22 +0100262 * (1 if there was a wraparound, i.e. if `A < B`, and 0 otherwise).
263 *
Tom Cosgrove5dd97e62022-08-30 14:31:49 +0100264 * \p X may be aliased to \p A or \p B, or even both, but may not overlap
265 * either otherwise.
Tom Cosgroveb4964862022-08-30 11:57:22 +0100266 *
267 * \param[out] X The result of the subtraction.
268 * \param[in] A Little-endian presentation of left operand.
269 * \param[in] B Little-endian presentation of right operand.
270 * \param limbs Number of limbs of \p X, \p A and \p B.
271 *
272 * \return 1 if `A < B`.
273 * 0 if `A >= B`.
274 */
275mbedtls_mpi_uint mbedtls_mpi_core_sub( mbedtls_mpi_uint *X,
276 const mbedtls_mpi_uint *A,
277 const mbedtls_mpi_uint *B,
278 size_t limbs );
279
280/**
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100281 * \brief Perform a fixed-size multiply accumulate operation: X += b * A
Tom Cosgroveb4964862022-08-30 11:57:22 +0100282 *
Tom Cosgroveb0b77e12022-09-20 13:33:40 +0100283 * \p X may be aliased to \p A (when \p X_limbs == \p A_limbs), but may not
284 * otherwise overlap.
285 *
Tom Cosgrove47828232022-09-20 13:51:50 +0100286 * This function operates modulo `2^(biL*X_limbs)`.
287 *
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100288 * \param[in,out] X The pointer to the (little-endian) array
Tom Cosgroveb4964862022-08-30 11:57:22 +0100289 * representing the bignum to accumulate onto.
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100290 * \param X_limbs The number of limbs of \p X. This must be
291 * at least \p A_limbs.
292 * \param[in] A The pointer to the (little-endian) array
Tom Cosgroveb4964862022-08-30 11:57:22 +0100293 * representing the bignum to multiply with.
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100294 * This may be aliased to \p X but may not overlap
Tom Cosgroveed43c6c2022-08-31 11:35:00 +0100295 * otherwise.
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100296 * \param A_limbs The number of limbs of \p A.
297 * \param b X scalar to multiply with.
Tom Cosgroveb4964862022-08-30 11:57:22 +0100298 *
299 * \return The carry at the end of the operation.
300 */
Tom Cosgrove3bd7bc32022-09-15 15:55:07 +0100301mbedtls_mpi_uint mbedtls_mpi_core_mla( mbedtls_mpi_uint *X, size_t X_limbs,
302 const mbedtls_mpi_uint *A, size_t A_limbs,
303 mbedtls_mpi_uint b );
Tom Cosgroveb4964862022-08-30 11:57:22 +0100304
305/**
306 * \brief Calculate initialisation value for fast Montgomery modular
307 * multiplication
308 *
309 * \param[in] N Little-endian presentation of the modulus. This must have
310 * at least one limb.
311 *
312 * \return The initialisation value for fast Montgomery modular multiplication
313 */
Tom Cosgroveb7438d12022-09-15 15:05:59 +0100314mbedtls_mpi_uint mbedtls_mpi_core_montmul_init( const mbedtls_mpi_uint *N );
Tom Cosgroveb4964862022-08-30 11:57:22 +0100315
316/**
Tom Cosgrove4386ead2022-09-29 14:40:21 +0100317 * \brief Montgomery multiplication: X = A * B * R^-1 mod N (HAC 14.36)
318 *
319 * \p A and \p B must be in canonical form. That is, < \p N.
Tom Cosgroveb4964862022-08-30 11:57:22 +0100320 *
Tom Cosgroveea45c1d2022-09-20 13:17:51 +0100321 * \p X may be aliased to \p A or \p N, or even \p B (if \p AN_limbs ==
322 * \p B_limbs) but may not overlap any parameters otherwise.
323 *
Tom Cosgrove4386ead2022-09-29 14:40:21 +0100324 * \p A and \p B may alias each other, if \p AN_limbs == \p B_limbs. They may
325 * not alias \p N (since they must be in canonical form, they cannot == \p N).
Tom Cosgroveea45c1d2022-09-20 13:17:51 +0100326 *
Tom Cosgroveb4964862022-08-30 11:57:22 +0100327 * \param[out] X The destination MPI, as a little-endian array of
328 * length \p AN_limbs.
329 * On successful completion, X contains the result of
Tom Cosgrove630110a2022-08-31 17:09:29 +0100330 * the multiplication `A * B * R^-1` mod N where
331 * `R = 2^(biL*AN_limbs)`.
Tom Cosgroveb4964862022-08-30 11:57:22 +0100332 * \param[in] A Little-endian presentation of first operand.
Tom Cosgrove5dd97e62022-08-30 14:31:49 +0100333 * Must have the same number of limbs as \p N.
Tom Cosgroveb4964862022-08-30 11:57:22 +0100334 * \param[in] B Little-endian presentation of second operand.
335 * \param[in] B_limbs The number of limbs in \p B.
Tom Cosgrove5dd97e62022-08-30 14:31:49 +0100336 * Must be <= \p AN_limbs.
Tom Cosgroveb4964862022-08-30 11:57:22 +0100337 * \param[in] N Little-endian presentation of the modulus.
Tom Cosgrove5dd97e62022-08-30 14:31:49 +0100338 * This must be odd, and have exactly the same number
339 * of limbs as \p A.
Tom Cosgrove6da3a3b2022-09-29 17:20:18 +0100340 * It may alias \p X, but must not alias or otherwise
341 * overlap any of the other parameters.
Tom Cosgrove5dd97e62022-08-30 14:31:49 +0100342 * \param[in] AN_limbs The number of limbs in \p X, \p A and \p N.
Tom Cosgrove630110a2022-08-31 17:09:29 +0100343 * \param mm The Montgomery constant for \p N: -N^-1 mod 2^biL.
Tom Cosgroveb7438d12022-09-15 15:05:59 +0100344 * This can be calculated by `mbedtls_mpi_core_montmul_init()`.
Tom Cosgroveb4964862022-08-30 11:57:22 +0100345 * \param[in,out] T Temporary storage of size at least 2*AN_limbs+1 limbs.
346 * Its initial content is unused and
347 * its final content is indeterminate.
Tom Cosgrove4386ead2022-09-29 14:40:21 +0100348 * It must not alias or otherwise overlap any of the
349 * other parameters.
Tom Cosgroveb4964862022-08-30 11:57:22 +0100350 */
351void mbedtls_mpi_core_montmul( mbedtls_mpi_uint *X,
352 const mbedtls_mpi_uint *A,
353 const mbedtls_mpi_uint *B, size_t B_limbs,
354 const mbedtls_mpi_uint *N, size_t AN_limbs,
355 mbedtls_mpi_uint mm, mbedtls_mpi_uint *T );
356
Gabor Mezeib9030702022-07-18 23:09:45 +0200357#endif /* MBEDTLS_BIGNUM_CORE_H */