xref: /interface/sdk_c/tee/include/tee_arith_api.h (revision 7777dab0)
1/*
2 * Copyright (c) 2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *    http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#ifndef TEE_ARITH_API_H
17#define TEE_ARITH_API_H
18
19/**
20 * @addtogroup TeeTrusted
21 * @{
22 *
23 * @brief TEE(Trusted Excution Environment) API.
24 * Provides security capability APIs such as trusted storage, encryption and decryption,
25 * and trusted time for trusted application development.
26 *
27 * @since 12
28 */
29
30/**
31 * @file tee_arith_api.h
32 *
33 * @brief Provides APIs for operating big integers.
34 *
35 * @library NA
36 * @kit TEEKit
37 * @syscap SystemCapability.Tee.TeeClient
38 * @since 12
39 * @version 1.0
40 */
41
42#include <tee_defines.h>
43
44#ifdef __cplusplus
45extern "C" {
46#endif
47
48typedef uint32_t TEE_BigInt;
49typedef uint32_t TEE_BigIntFMM;
50typedef uint32_t TEE_BigIntFMMContext;
51
52/**
53 * @brief Obtains the size of the array of uint32_t values required to represent a <b>BigInt</b>.
54 *
55 * @param n Indicates the <b>TEE_BigInt</b> type.
56 *
57 * @return Returns the <b>BigInt</b> size obtained.
58 *
59 * @since 12
60 * @version 1.0
61 */
62#define TEE_BigIntSizeInU32(n) ((((n) + 31) / 32) + 2)
63
64/**
65 * @brief Obtains the size of the array of uint32_t values.
66 *
67 * @param modulusSizeInBits Indicates the modulus size, in bits.
68 *
69 * @return Returns the number of bytes required to store a <b>TEE_BigIntFMM</b>,
70 * given a modulus of length <b>modSizeInBits</b>.
71 *
72 * @since 12
73 * @version 1.0
74 */
75size_t TEE_BigIntFMMSizeInU32(size_t modulusSizeInBits);
76
77/**
78 * @brief Obtains the size of an array of uint32_t values required to represent a fast modular context.
79 *
80 * @param modulusSizeInBits Indicates the modulus size, in bits.
81 *
82 * @return Returns the number of bytes required to store a <b>TEE_BigIntFMMContext</b>,
83 * given a modulus of length <b>modSizeInBits</b>.
84 *
85 * @since 12
86 * @version 1.0
87 */
88size_t TEE_BigIntFMMContextSizeInU32(size_t modulusSizeInBits);
89
90/**
91 * @brief Initializes a <b>TEE_BigInt</b>.
92 *
93 * @param bigInt Indicates the pointer to the <b>TEE_BigInt</b> to initialize.
94 * @param len Indicates the size of the memory pointed to by <b>TEE_BigInt</b>, in uint32_t.
95 *
96 * @since 12
97 * @version 1.0
98 */
99void TEE_BigIntInit(TEE_BigInt *bigInt, size_t len);
100
101/**
102 * @brief Calculates the necessary prerequisites for fast modular multiplication and stores them in a context.
103 *
104 * @param context Indicates the pointer to the <b>TEE_BigIntFMMContext</b> to initialize.
105 * @param len Indicates the size of the memory pointed to by <b>context</b>, in uint32_t.
106 * @param modulus Indicates the pointer to the modulus.
107 *
108 * @since 12
109 * @version 1.0
110 */
111void TEE_BigIntInitFMMContext(TEE_BigIntFMMContext *context, size_t len, const TEE_BigInt *modulus);
112
113/**
114 * @brief Calculates the necessary prerequisites for fast modular multiplication and stores them in a context.
115 *
116 * @param context Indicates the pointer to the <b>TEE_BigIntFMMContext</b> to initialize.
117 * @param len Indicates the size of the memory pointed to by <b>context</b>, in uint32_t.
118 * @param modulus Indicates the pointer to the modulus.
119 *
120 * @return Returns <b>TEE_SUCCESS</b> if the operation is successful.
121 *         Returns other values if the operation fails.
122 *
123 * @since 12
124 * @version 1.0
125 */
126TEE_Result TEE_BigIntInitFMMContext1(TEE_BigIntFMMContext *context, size_t len, const TEE_BigInt *modulus);
127
128/**
129 * @brief Initializes a <b>TEE_BigIntFMM</b> and sets its represented value to zero.
130 *
131 * @param bigIntFMM Indicates the pointer to the <b>TEE_BigIntFMM</b> to initialize.
132 * @param len Indicates the size of the memory pointed to by <b>bigIntFMM</b>, in uint32_t.
133 *
134 * @since 12
135 * @version 1.0
136 */
137void TEE_BigIntInitFMM(TEE_BigIntFMM *bigIntFMM, size_t len);
138
139/**
140 * @brief Converts an octet string buffer into the <b>TEE_BigInt</b> format.
141 *
142 * @param dest Indicates the pointer to the <b>TEE_BigInt</b> that holds the result.
143 * @param buffer Indicates the pointer to the buffer that holds the octet string representation of the integer.
144 * @param bufferLen Indicates the buffer length, in bytes.
145 * @param sign Indicates the sign of <b>dest</b>, which is set to the sign of <b>sign</b>.
146 *
147 * @return Returns <b>TEE_SUCCESS</b> if the operation is successful.
148 *         Returns <b>TEE_ERROR_OVERFLOW</b> if the memory allocated for <b>dest</b> is too small.
149 *
150 * @since 12
151 * @version 1.0
152 */
153TEE_Result TEE_BigIntConvertFromOctetString(TEE_BigInt *dest, const uint8_t *buffer, size_t bufferLen, int32_t sign);
154
155/**
156 * @brief Converts the absolute value of an integer in <b>TEE_BigInt</b> format into an octet string.
157 *
158 * @param buffer Indicates the pointer to the output buffer that holds the converted octet string representation
159 * of the integer.
160 * @param bufferLen Indicates the pointer to the buffer length, in bytes.
161 * @param bigInt Indicates the pointer to the integer to convert.
162 *
163 * @return Returns <b>TEE_SUCCESS</b> if the operation is successful.
164 *         Returns <b>TEE_ERROR_SHORT_BUFFER</b> if the output buffer is too small to hold the octet string.
165 *
166 * @since 12
167 * @version 1.0
168 */
169TEE_Result TEE_BigIntConvertToOctetString(void *buffer, size_t *bufferLen, const TEE_BigInt *bigInt);
170
171/**
172 * @brief Sets <b>dest</b> to the value <b>shortVal</b>.
173 *
174 * @param dest Indicates the pointer to the <b>TEE_BigInt</b> that holds the result.
175 * @param shortVal Indicates the value to set.
176 *
177 * @since 12
178 * @version 1.0
179 */
180void TEE_BigIntConvertFromS32(TEE_BigInt *dest, int32_t shortVal);
181
182/**
183 * @brief Sets <b>dest</b> to the value of <b>src</b>, including the sign of <b>src</b>.
184 *
185 * @param dest Indicates the pointer to the <b> int32_t</b> that holds the result.
186 * @param src Indicates the pointer to the value to set.
187 *
188 * @return Returns <b>TEE_SUCCESS</b> if the operation is successful.
189 *         Returns <b>TEE_ERROR_OVERFLOW</b> if <b>src</b> does not fit within an <b> int32_t</b>.
190 *
191 * @since 12
192 * @version 1.0
193 */
194TEE_Result TEE_BigIntConvertToS32(int32_t *dest, const TEE_BigInt *src);
195
196/**
197 * @brief Checks whether op1 > op2, op1 == op2, or op1 < op2.
198 *
199 * @param op1 Indicates the pointer to the first operand.
200 * @param op2 Indicates the pointer to the second operand.
201 *
202 * @return Returns <b>0</b> if op1 == op2.
203 *         Returns a positive number if op1 > op2.
204 *
205 * @since 12
206 * @version 1.0
207 */
208int32_t TEE_BigIntCmp(const TEE_BigInt *op1, const TEE_BigInt *op2);
209
210/**
211 * @brief Checks whether op > shortVal, op == shortVal, or op < shortVal.
212 *
213 * @param op Indicates the pointer to the first operand.
214 * @param shortVal Indicates the pointer to the second operand.
215 *
216 * @return Returns <b>0</b> if op1 == shortVal.
217 *         Returns a positive number if op1 > shortVal.
218 *
219 * @since 12
220 * @version 1.0
221 */
222int32_t TEE_BigIntCmpS32(const TEE_BigInt *op, int32_t shortVal);
223
224/**
225 * @brief Computes |dest| = |op| >> bits.
226 *
227 * @param dest Indicates the pointer to the <b>TEE_BigInt</b> that holds the shifted result.
228 * @param op Indicates the pointer to the operand to be shifted.
229 * @param bits Indicates the number of bits to shift.
230 *
231 * @since 12
232 * @version 1.0
233 */
234void TEE_BigIntShiftRight(TEE_BigInt *dest, const TEE_BigInt *op, size_t bits);
235
236/**
237 * @brief Obtains the <b>bitIndex</b> bit of the natural binary representation of |src|.
238 *
239 * @param src Indicates the pointer to the integer.
240 * @param bitIndex Indicates the offset of the bit to read, starting from offset <b>0</b> of the least significant bit.
241 *
242 * @return Returns the Boolean value of <b>bitIndexth</b> in |src|. The value <b>true</b> represents a <b>1</b>,
243 * and <b>false</b> represents a <b>0</b>.
244 *
245 * @since 12
246 * @version 1.0
247 */
248bool TEE_BigIntGetBit(const TEE_BigInt *src, uint32_t bitIndex);
249
250/**
251 * @brief Obtains the number of bits in the natural binary representation of |src|,
252 * that is, the magnitude of <b>src</b>.
253 *
254 * @param src Indicates the pointer to the integer.
255 *
256 * @return Returns <b>0</b> if <b>src</b> is <b>0</b>.
257 *         Returns the number of bits in the natural binary representation of <b>src</b>.
258 *
259 * @since 12
260 * @version 1.0
261 */
262uint32_t TEE_BigIntGetBitCount(const TEE_BigInt *src);
263
264#if defined(API_LEVEL) && (API_LEVEL >= API_LEVEL1_2)
265/**
266 * @brief Sets the first bit of <b>bitIndex</b> in the natural binary representation of <b>op</b> to
267 * <b>1</b> or <b>0</b>.
268 *
269 * @param op Indicates the pointer to the integer.
270 * @param bitIndex Indicates the offset of the bit to set, starting from offset <b>0</b> of the least significant bit.
271 * @param value Indicates the bit value to set. The value <b>true</b> represents a <b>1</b>, and the value <b>false</b>
272 * represents a <b>0</b>.
273 *
274 * @return Returns <b>TEE_SUCCESS</b> if the operation is successful.
275 *         Returns <b>TEE_ERROR_OVERFLOW bitIndexth</b> if the <b>bitIndexth</b> bit is larger than the allocated bit
276 * length of <b>op</b>.
277 *
278 * @since 12
279 * @version 1.0
280 */
281TEE_Result TEE_BigIntSetBit(TEE_BigInt *op, uint32_t bitIndex, bool value);
282
283/**
284 * @brief Assigns the value of <b>src</b> to <b>dest</b>.
285 *
286 * @param dest Indicates the pointer to the <b>TEE_BigInt</b> to be assigned.
287 * @param src Indicates the pointer to the source operand.
288 *
289 * @return Returns <b>TEE_SUCCESS</b> if the operation is successful.
290 *         Returns <b>TEE_ERROR_OVERFLOW</b> if the <b>dest</b> operand cannot hold the value of <b>src</b>.
291 *
292 * @since 12
293 * @version 1.0
294 */
295TEE_Result TEE_BigIntAssign(TEE_BigInt *dest, const TEE_BigInt *src);
296
297/**
298 * @brief Assigns the value of <b>src</b> to <b>dest</b>.
299 *
300 * @param dest Indicates the pointer to the <b>TEE_BigInt</b> to be assigned.
301 * @param src Indicates the pointer to the source operand.
302 *
303 * @return Returns <b>TEE_SUCCESS</b> if the operation is successful.
304 *         Returns <b>TEE_ERROR_OVERFLOW</b> if the <b>dest</b> operand cannot hold the value of <b>src</b>.
305 *
306 * @since 12
307 * @version 1.0
308 */
309TEE_Result TEE_BigIntAbs(TEE_BigInt *dest, const TEE_BigInt *src);
310#endif /* API_LEVEL */
311
312/**
313 * @brief Computes dest = op1 + op2.
314 *
315 * @param dest Indicates the pointer to the <b>TEE_BigInt</b> that holds the sum of <b>op1</b> and <b>op2</b>.
316 * @param op1 Indicates the pointer to the first operand.
317 * @param op2 Indicates the pointer to the second operand.
318 *
319 * @since 12
320 * @version 1.0
321 */
322void TEE_BigIntAdd(TEE_BigInt *dest, const TEE_BigInt *op1, const TEE_BigInt *op2);
323
324/**
325 * @brief Computes dest = op1 – op2.
326 *
327 * @param dest Indicates the pointer to the <b>TEE_BigInt</b> that holds the difference between <b>op1</b>
328 * and <b>op2</b>.
329 * @param op1 Indicates the pointer to the first operand.
330 * @param op2 Indicates the pointer to the second operand.
331 *
332 * @since 12
333 * @version 1.0
334 */
335void TEE_BigIntSub(TEE_BigInt *dest, const TEE_BigInt *op1, const TEE_BigInt *op2);
336
337/**
338 * @brief Negates an operand: dest = –op.
339 *
340 * @param dest Indicates the pointer to the <b>TEE_BigInt</b> that holds the result –op.
341 * @param op Indicates the pointer to the operand to be negated.
342 *
343 * @since 12
344 * @version 1.0
345 */
346void TEE_BigIntNeg(TEE_BigInt *dest, const TEE_BigInt *op);
347
348/**
349 * @brief Computes dest = op1 * op2.
350 *
351 * @param dest Indicates the pointer to the <b>TEE_BigInt</b> that holds the product of <b>op1</b> and <b>op2</b>.
352 * @param op1 Indicates the pointer to the first operand.
353 * @param op2 Indicates the pointer to the second operand.
354 *
355 * @since 12
356 * @version 1.0
357 */
358void TEE_BigIntMul(TEE_BigInt *dest, const TEE_BigInt *op1, const TEE_BigInt *op2);
359
360/**
361 * @brief Computes dest = op * op.
362 *
363 * @param dest Indicates the pointer to the <b>TEE_BigInt</b> that holds the result op * op.
364 * @param op Indicates the pointer to the operand to be squared.
365 *
366 * @since 12
367 * @version 1.0
368 */
369void TEE_BigIntSquare(TEE_BigInt *dest, const TEE_BigInt *op);
370
371/**
372 * @brief Computes <b>dest_r</b> and <b>dest_q</b> to make op1 = dest_q* op2 + dest_r.
373 *
374 * @param dest_q Indicates the pointer to the <b>TEE_BigInt</b> that holds the quotient.
375 * @param dest_r Indicates the pointer to the <b>TEE_BigInt</b> that holds the remainder.
376 * @param op1 Indicates the pointer to the first operand, which is the dividend.
377 * @param op2 Indicates the pointer to the second operand, which is the divisor.
378 *
379 * @return Returns <b>TEE_SUCCESS</b> if the operation is successful.
380 *         Returns <b>TEE_ERROR_BAD_PARAMETERS</b> if at least one parameter is null.
381 *
382 * @since 12
383 * @version 1.0
384 */
385void TEE_BigIntDiv(TEE_BigInt *dest_q, TEE_BigInt *dest_r, const TEE_BigInt *op1, const TEE_BigInt *op2);
386
387/**
388 * @brief Computes dest = op (mod n) to make 0 <= dest < n.
389 *
390 * @param dest Indicates the pointer to the <b>TEE_BigInt</b> that holds the result op (mod n).
391 * @param op Indicates the pointer to the operand to be reduced mod n.
392 * @param n [IN] Indicates the pointer to the modulus, which must be greater than 1.
393 *
394 * @since 12
395 * @version 1.0
396 */
397void TEE_BigIntMod(TEE_BigInt *dest, const TEE_BigInt *op, const TEE_BigInt *n);
398
399/**
400 * @brief Computes dest = (op1 + op2) (mod n).
401 *
402 * @param dest Indicates the pointer to the <b>TEE_BigInt</b> that holds the result op (op1 + op2)(mod n).
403 * @param op1 Indicates the pointer to the first operand.
404 * @param op2 Indicates the pointer to the second operand.
405 * @param n Indicates the pointer to the modulus, which must be greater than 1.
406 *
407 * @since 12
408 * @version 1.0
409 */
410void TEE_BigIntAddMod(TEE_BigInt *dest, const TEE_BigInt *op1, const TEE_BigInt *op2, const TEE_BigInt *n);
411
412/**
413 * @brief Computes dest = (op1 – op2) (mod n).
414 *
415 * @param dest Indicates the pointer to the <b>TEE_BigInt</b> that holds the result op (op1 – op2)(mod n).
416 * @param op1 Indicates the pointer to the first operand.
417 * @param op2 Indicates the pointer to the second operand.
418 * @param n Indicates the pointer to the modulus, which must be greater than 1.
419 *
420 * @since 12
421 * @version 1.0
422 */
423void TEE_BigIntSubMod(TEE_BigInt *dest, const TEE_BigInt *op1, const TEE_BigInt *op2, const TEE_BigInt *n);
424
425/**
426 * @brief Computes dest = (op1* op2)(mod n).
427 *
428 * @param dest Indicates the pointer to the <b>TEE_BigInt</b> that holds the result op (op1 * op2)(mod n).
429 * @param op1 Indicates the pointer to the first operand.
430 * @param op2 Indicates the pointer to the second operand.
431 * @param n Indicates the pointer to the modulus, which must be greater than 1.
432 *
433 * @since 12
434 * @version 1.0
435 */
436void TEE_BigIntMulMod(TEE_BigInt *dest, const TEE_BigInt *op1, const TEE_BigInt *op2, const TEE_BigInt *n);
437
438/**
439 * @brief Computes dest = (op * op) (mod n).
440 *
441 * @param dest Indicates the pointer to the <b>TEE_BigInt</b> that holds the result op (op * op)(mod n).
442 * @param op Indicates the pointer to the operand.
443 * @param n [IN] Indicates the pointer to the modulus, which must be greater than 1.
444 *
445 * @since 12
446 * @version 1.0
447 */
448void TEE_BigIntSquareMod(TEE_BigInt *dest, const TEE_BigInt *op, const TEE_BigInt *n);
449
450/**
451 * @brief Computes <b>dest</b> to make dest* op = 1 (mod n).
452 *
453 * @param dest Indicates the pointer to the <b>TEE_BigInt</b> that holds the result (op^–1)(mod n).
454 * @param op Indicates the pointer to the operand.
455 * @param n [IN] Indicates the pointer to the modulus, which must be greater than 1.
456 *
457 * @since 12
458 * @version 1.0
459 */
460void TEE_BigIntInvMod(TEE_BigInt *dest, const TEE_BigInt *op, const TEE_BigInt *n);
461
462/**
463 * @brief Checks whether gcd(op1, op2) == 1.
464 *
465 * @param op1 Indicates the pointer to the first operand.
466 * @param op2 Indicates the pointer to the second operand.
467 *
468 * @return Returns <b>true</b> if gcd(op1, op2) == 1.
469 *         Returns <b>false</b> if gcd(op1, op2) != 1.
470 *
471 * @since 12
472 * @version 1.0
473 */
474bool TEE_BigIntRelativePrime(const TEE_BigInt *op1, const TEE_BigInt *op2);
475
476/**
477 * @brief Computes the greatest common divisor of <b>op1</b> and <b>op2</b>.
478 *
479 * @param gcd Indicates the pointer to the <b>TEE_BigInt</b> that holds the greatest common divisor of <b>op1</b>
480 * and <b>op2</b>.
481 * @param u Indicates the pointer to the <b>TEE_BigInt</b> that holds the first coefficient.
482 * @param v Indicates the pointer to the <b>TEE_BigInt</b> that holds the second coefficient.
483 * @param op1 Indicates the pointer to the first operand.
484 * @param op2 Indicates the pointer to the second operand.
485 *
486 * @since 12
487 * @version 1.0
488 */
489void TEE_BigIntComputeExtendedGcd(TEE_BigInt *gcd, TEE_BigInt *u, TEE_BigInt *v, const TEE_BigInt *op1,
490                                  const TEE_BigInt *op2);
491/**
492 * @brief Performs a probabilistic primality test on <b>op</b>.
493 *
494 * @param op Indicates the pointer to the candidate number that is tested for primality.
495 * @param confidenceLevel Indicates the expected confidence level for a non-conclusive test.
496 *
497 * @return Returns <b>0</b> if <b>op</b> is a composite number.
498 *         Returns <b>1</b> if <b>op</b> is a prime number.
499 *         Returns <b>–1</b> if the test is non-conclusive but the probability that <b>op</b> is composite is
500 * less than 2^(-confidenceLevel).
501 *
502 * @since 12
503 * @version 1.0
504 */
505int32_t TEE_BigIntIsProbablePrime(const TEE_BigInt *op, uint32_t confidenceLevel);
506
507/**
508 * @brief Converts <b>src</b> into a representation suitable for doing fast modular multiplication.
509 *
510 * @param dest Indicates the pointer to an initialized <b>TEE_BigIntFMM</b> memory area.
511 * @param src Indicates the pointer to the <b>TEE_BigInt</b> to convert.
512 * @param n Indicates the pointer to the modulus.
513 * @param context Indicates the pointer to the context that is previously initialized using
514 * {@link TEE_BigIntInitFMMContext1}.
515 *
516 * @since 12
517 * @version 1.0
518 */
519void TEE_BigIntConvertToFMM(TEE_BigIntFMM *dest, const TEE_BigInt *src, const TEE_BigInt *n,
520                            const TEE_BigIntFMMContext *context);
521
522/**
523 * @brief Converts <b>src</b> in the fast modular multiplication representation back to a
524 * <b>TEE_BigInt</b> representation.
525 *
526 * @param dest Indicates the pointer to an initialized <b>TEE_BigIntFMM</b> memory area to store the converted result.
527 * @param src Indicates the pointer to a <b>TEE_BigIntFMM</b> holding the value in the fast modular multiplication
528 * representation.
529 * @param n Indicates the pointer to the modulus.
530 * @param context Indicates the pointer to the context that is previously initialized using
531 * {@link TEE_BigIntInitFMMContext1}.
532 *
533 * @since 12
534 * @version 1.0
535 */
536void TEE_BigIntConvertFromFMM(TEE_BigInt *dest, const TEE_BigIntFMM *src, const TEE_BigInt *n,
537                              const TEE_BigIntFMMContext *context);
538
539/**
540 * @brief Computes dest = op1* op2 in the fast modular multiplication representation.
541 *
542 * @param dest Indicates the pointer to the <b>TEE_BigIntFMM</b> that holds the result op1* op2.
543 * @param op1 Indicates the pointer to the first operand.
544 * @param op2 Indicates the pointer to the second operand.
545 * @param n Indicates the pointer to the modulus.
546 * @param context Indicates the pointer to the context that is previously initialized using
547 * {@link TEE_BigIntInitFMMContext1}.
548 *
549 * @since 12
550 * @version 1.0
551 */
552void TEE_BigIntComputeFMM(TEE_BigIntFMM *dest, const TEE_BigIntFMM *op1, const TEE_BigIntFMM *op2, const TEE_BigInt *n,
553                          const TEE_BigIntFMMContext *context);
554
555/**
556 * @brief Computes dest = (op1 ^ op2)(mod n).
557 *
558 * @param des Indicates the pointer to the <b>TEE_BigInt</b> that holds the result (op1 ^ op2)(mod n).
559 * @param op1 Indicates the pointer to the first operand.
560 * @param op2 Indicates the pointer to the second operand.
561 * @param n Indicates the pointer to the modulus.
562 * @param context Indicates the pointer to the context that is previously initialized using
563 * {@link TEE_BigIntInitFMMContext1} or initialized to null.
564 *
565 * @return Returns <b>TEE_SUCCESS</b> if the operation is successful.
566 *         Returns <b>TEE_ERROR_NOT_SUPPORTED</b> if the value of <b>n</b> is not supported.
567 *
568 * @since 12
569 * @version 1.0
570 */
571TEE_Result TEE_BigIntExpMod(TEE_BigInt *des, TEE_BigInt *op1, const TEE_BigInt *op2, const TEE_BigInt *n,
572                            TEE_BigIntFMMContext *context);
573
574#ifdef __cplusplus
575}
576#endif
577/** @} */
578#endif
579