RetroArch
bignum.h
Go to the documentation of this file.
1 
23 #ifndef MBEDTLS_BIGNUM_H
24 #define MBEDTLS_BIGNUM_H
25 
26 #if !defined(MBEDTLS_CONFIG_FILE)
27 #include "config.h"
28 #else
29 #include MBEDTLS_CONFIG_FILE
30 #endif
31 
32 #include <stddef.h>
33 #include <stdint.h>
34 
35 #if defined(MBEDTLS_FS_IO)
36 #include <stdio.h>
37 #endif
38 
39 #define MBEDTLS_ERR_MPI_FILE_IO_ERROR -0x0002
40 #define MBEDTLS_ERR_MPI_BAD_INPUT_DATA -0x0004
41 #define MBEDTLS_ERR_MPI_INVALID_CHARACTER -0x0006
42 #define MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL -0x0008
43 #define MBEDTLS_ERR_MPI_NEGATIVE_VALUE -0x000A
44 #define MBEDTLS_ERR_MPI_DIVISION_BY_ZERO -0x000C
45 #define MBEDTLS_ERR_MPI_NOT_ACCEPTABLE -0x000E
46 #define MBEDTLS_ERR_MPI_ALLOC_FAILED -0x0010
48 #define MBEDTLS_MPI_CHK(f) do { if( ( ret = f ) != 0 ) goto cleanup; } while( 0 )
49 
50 /*
51  * Maximum size MPIs are allowed to grow to in number of limbs.
52  */
53 #define MBEDTLS_MPI_MAX_LIMBS 10000
54 
55 #if !defined(MBEDTLS_MPI_WINDOW_SIZE)
56 /*
57  * Maximum window size used for modular exponentiation. Default: 6
58  * Minimum value: 1. Maximum value: 6.
59  *
60  * Result is an array of ( 2 << MBEDTLS_MPI_WINDOW_SIZE ) MPIs used
61  * for the sliding window calculation. (So 64 by default)
62  *
63  * Reduction in size, reduces speed.
64  */
65 #define MBEDTLS_MPI_WINDOW_SIZE 6
66 #endif /* !MBEDTLS_MPI_WINDOW_SIZE */
67 
68 #if !defined(MBEDTLS_MPI_MAX_SIZE)
69 /*
70  * Maximum size of MPIs allowed in bits and bytes for user-MPIs.
71  * ( Default: 512 bytes => 4096 bits, Maximum tested: 2048 bytes => 16384 bits )
72  *
73  * Note: Calculations can results temporarily in larger MPIs. So the number
74  * of limbs required (MBEDTLS_MPI_MAX_LIMBS) is higher.
75  */
76 #define MBEDTLS_MPI_MAX_SIZE 1024
77 #endif /* !MBEDTLS_MPI_MAX_SIZE */
78 
79 #define MBEDTLS_MPI_MAX_BITS ( 8 * MBEDTLS_MPI_MAX_SIZE )
81 /*
82  * When reading from files with mbedtls_mpi_read_file() and writing to files with
83  * mbedtls_mpi_write_file() the buffer should have space
84  * for a (short) label, the MPI (in the provided radix), the newline
85  * characters and the '\0'.
86  *
87  * By default we assume at least a 10 char label, a minimum radix of 10
88  * (decimal) and a maximum of 4096 bit numbers (1234 decimal chars).
89  * Autosized at compile time for at least a 10 char label, a minimum radix
90  * of 10 (decimal) for a number of MBEDTLS_MPI_MAX_BITS size.
91  *
92  * This used to be statically sized to 1250 for a maximum of 4096 bit
93  * numbers (1234 decimal chars).
94  *
95  * Calculate using the formula:
96  * MBEDTLS_MPI_RW_BUFFER_SIZE = ceil(MBEDTLS_MPI_MAX_BITS / ln(10) * ln(2)) +
97  * LabelSize + 6
98  */
99 #define MBEDTLS_MPI_MAX_BITS_SCALE100 ( 100 * MBEDTLS_MPI_MAX_BITS )
100 #define MBEDTLS_LN_2_DIV_LN_10_SCALE100 332
101 #define MBEDTLS_MPI_RW_BUFFER_SIZE ( ((MBEDTLS_MPI_MAX_BITS_SCALE100 + MBEDTLS_LN_2_DIV_LN_10_SCALE100 - 1) / MBEDTLS_LN_2_DIV_LN_10_SCALE100) + 10 + 6 )
102 
103 /*
104  * Define the base integer type, architecture-wise.
105  *
106  * 32 or 64-bit integer types can be forced regardless of the underlying
107  * architecture by defining MBEDTLS_HAVE_INT32 or MBEDTLS_HAVE_INT64
108  * respectively and undefining MBEDTLS_HAVE_ASM.
109  *
110  * Double-width integers (e.g. 128-bit in 64-bit architectures) can be
111  * disabled by defining MBEDTLS_NO_UDBL_DIVISION.
112  */
113 #if !defined(MBEDTLS_HAVE_INT32)
114  #if defined(_MSC_VER) && defined(_M_AMD64)
115  /* Always choose 64-bit when using MSC */
116  #if !defined(MBEDTLS_HAVE_INT64)
117  #define MBEDTLS_HAVE_INT64
118  #endif /* !MBEDTLS_HAVE_INT64 */
119  typedef int64_t mbedtls_mpi_sint;
120  typedef uint64_t mbedtls_mpi_uint;
121  #elif defined(__GNUC__) && ( \
122  defined(__amd64__) || defined(__x86_64__) || \
123  defined(__ppc64__) || defined(__powerpc64__) || \
124  defined(__ia64__) || defined(__alpha__) || \
125  ( defined(__sparc__) && defined(__arch64__) ) || \
126  defined(__s390x__) || defined(__mips64) )
127  #if !defined(MBEDTLS_HAVE_INT64)
128  #define MBEDTLS_HAVE_INT64
129  #endif /* MBEDTLS_HAVE_INT64 */
130  typedef int64_t mbedtls_mpi_sint;
131  typedef uint64_t mbedtls_mpi_uint;
132  #if !defined(MBEDTLS_NO_UDBL_DIVISION)
133  /* mbedtls_t_udbl defined as 128-bit unsigned int */
134  typedef unsigned int mbedtls_t_udbl __attribute__((mode(TI)));
135  #define MBEDTLS_HAVE_UDBL
136  #endif /* !MBEDTLS_NO_UDBL_DIVISION */
137  #elif defined(__ARMCC_VERSION) && defined(__aarch64__)
138  /*
139  * __ARMCC_VERSION is defined for both armcc and armclang and
140  * __aarch64__ is only defined by armclang when compiling 64-bit code
141  */
142  #if !defined(MBEDTLS_HAVE_INT64)
143  #define MBEDTLS_HAVE_INT64
144  #endif /* !MBEDTLS_HAVE_INT64 */
145  typedef int64_t mbedtls_mpi_sint;
146  typedef uint64_t mbedtls_mpi_uint;
147  #if !defined(MBEDTLS_NO_UDBL_DIVISION)
148  /* mbedtls_t_udbl defined as 128-bit unsigned int */
149  typedef __uint128_t mbedtls_t_udbl;
150  #define MBEDTLS_HAVE_UDBL
151  #endif /* !MBEDTLS_NO_UDBL_DIVISION */
152  #elif defined(MBEDTLS_HAVE_INT64)
153  /* Force 64-bit integers with unknown compiler */
154  typedef int64_t mbedtls_mpi_sint;
155  typedef uint64_t mbedtls_mpi_uint;
156  #endif
157 #endif /* !MBEDTLS_HAVE_INT32 */
158 
159 #if !defined(MBEDTLS_HAVE_INT64)
160  /* Default to 32-bit compilation */
161  #if !defined(MBEDTLS_HAVE_INT32)
162  #define MBEDTLS_HAVE_INT32
163  #endif /* !MBEDTLS_HAVE_INT32 */
166  #if !defined(MBEDTLS_NO_UDBL_DIVISION)
168  #define MBEDTLS_HAVE_UDBL
169  #endif /* !MBEDTLS_NO_UDBL_DIVISION */
170 #endif /* !MBEDTLS_HAVE_INT64 */
171 
172 #ifdef __cplusplus
173 extern "C" {
174 #endif
175 
179 typedef struct
180 {
181  int s;
182  size_t n;
184 }
186 
195 
202 
212 int mbedtls_mpi_grow( mbedtls_mpi *X, size_t nblimbs );
213 
223 int mbedtls_mpi_shrink( mbedtls_mpi *X, size_t nblimbs );
224 
234 int mbedtls_mpi_copy( mbedtls_mpi *X, const mbedtls_mpi *Y );
235 
243 
261 int mbedtls_mpi_safe_cond_assign( mbedtls_mpi *X, const mbedtls_mpi *Y, unsigned char assign );
262 
280 int mbedtls_mpi_safe_cond_swap( mbedtls_mpi *X, mbedtls_mpi *Y, unsigned char assign );
281 
292 
301 int mbedtls_mpi_get_bit( const mbedtls_mpi *X, size_t pos );
302 
317 int mbedtls_mpi_set_bit( mbedtls_mpi *X, size_t pos, unsigned char val );
318 
327 size_t mbedtls_mpi_lsb( const mbedtls_mpi *X );
328 
337 size_t mbedtls_mpi_bitlen( const mbedtls_mpi *X );
338 
344 size_t mbedtls_mpi_size( const mbedtls_mpi *X );
345 
355 int mbedtls_mpi_read_string( mbedtls_mpi *X, int radix, const char *s );
356 
373 int mbedtls_mpi_write_string( const mbedtls_mpi *X, int radix,
374  char *buf, size_t buflen, size_t *olen );
375 
376 #if defined(MBEDTLS_FS_IO)
377 
397 int mbedtls_mpi_read_file( mbedtls_mpi *X, int radix, FILE *fin );
398 
411 int mbedtls_mpi_write_file( const char *p, const mbedtls_mpi *X, int radix, FILE *fout );
412 #endif /* MBEDTLS_FS_IO */
413 
424 int mbedtls_mpi_read_binary( mbedtls_mpi *X, const unsigned char *buf, size_t buflen );
425 
438 int mbedtls_mpi_write_binary( const mbedtls_mpi *X, unsigned char *buf, size_t buflen );
439 
449 int mbedtls_mpi_shift_l( mbedtls_mpi *X, size_t count );
450 
460 int mbedtls_mpi_shift_r( mbedtls_mpi *X, size_t count );
461 
472 int mbedtls_mpi_cmp_abs( const mbedtls_mpi *X, const mbedtls_mpi *Y );
473 
484 int mbedtls_mpi_cmp_mpi( const mbedtls_mpi *X, const mbedtls_mpi *Y );
485 
497 
508 int mbedtls_mpi_add_abs( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *B );
509 
520 int mbedtls_mpi_sub_abs( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *B );
521 
532 int mbedtls_mpi_add_mpi( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *B );
533 
544 int mbedtls_mpi_sub_mpi( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *B );
545 
557 
569 
580 int mbedtls_mpi_mul_mpi( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *B );
581 
595 
611 
627 
640 int mbedtls_mpi_mod_mpi( mbedtls_mpi *R, const mbedtls_mpi *A, const mbedtls_mpi *B );
641 
655 
674 int mbedtls_mpi_exp_mod( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *E, const mbedtls_mpi *N, mbedtls_mpi *_RR );
675 
688  int (*f_rng)(void *, unsigned char *, size_t),
689  void *p_rng );
690 
701 int mbedtls_mpi_gcd( mbedtls_mpi *G, const mbedtls_mpi *A, const mbedtls_mpi *B );
702 
715 int mbedtls_mpi_inv_mod( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *N );
716 
729  int (*f_rng)(void *, unsigned char *, size_t),
730  void *p_rng );
731 
746 int mbedtls_mpi_gen_prime( mbedtls_mpi *X, size_t nbits, int dh_flag,
747  int (*f_rng)(void *, unsigned char *, size_t),
748  void *p_rng );
749 
755 int mbedtls_mpi_self_test( int verbose );
756 
757 #ifdef __cplusplus
758 }
759 #endif
760 
761 #endif /* bignum.h */
int mbedtls_mpi_grow(mbedtls_mpi *X, size_t nblimbs)
Enlarge to the specified number of limbs.
Definition: bignum.c:114
int mbedtls_mpi_write_file(const char *p, const mbedtls_mpi *X, int radix, FILE *fout)
Write X into an opened file, or stdout if fout is NULL.
Definition: bignum.c:633
int mbedtls_mpi_div_int(mbedtls_mpi *Q, mbedtls_mpi *R, const mbedtls_mpi *A, mbedtls_mpi_sint b)
Division by int: A = Q * b + R.
Definition: bignum.c:1437
GLenum mode
Definition: glext.h:6857
GLuint GLfloat * val
Definition: glext.h:7847
int mbedtls_mpi_div_mpi(mbedtls_mpi *Q, mbedtls_mpi *R, const mbedtls_mpi *A, const mbedtls_mpi *B)
Division by mbedtls_mpi: A = Q * B + R.
Definition: bignum.c:1322
int mbedtls_mpi_add_mpi(mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *B)
Signed addition: X = A + B.
Definition: bignum.c:1007
#define G(L)
Definition: lstate.h:205
void mbedtls_mpi_free(mbedtls_mpi *X)
Unallocate one MPI.
Definition: bignum.c:95
Configuration options (set of defines)
mbedtls_mpi_uint * p
Definition: bignum.h:183
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:8418
size_t mbedtls_mpi_bitlen(const mbedtls_mpi *X)
Return the number of bits up to and including the most significant '1' bit'.
Definition: bignum.c:380
Ιστορικό Εικόνα Πληροφορίες Όλοι Οι Χρήστες Χειρίζονται Το Μενού Αριστερό Αναλογικό Αριστερό Αναλογικό Αριστερό Αναλογικό Y Αριστερό Αναλογικό Δεξί Αναλογικό X Δεξί Αναλογικό Δεξί Αναλογικό Y Δεξί Αναλογικό Σκανδάλη Όπλου Όπλο Aux A Όπλο Aux C Όπλο Select Όπλο D pad Κάτω Όπλο D pad Δεξιά Νεκρή Ζώνη Αναλογικού Σύνδεση Όλων Λήξη Χρόνου Σύνδεσης Hide Unbound Core Input Descriptors Κατάλογος Συσκευών Κατάλογος Ποντικιού Duty Cycle Keyboard Gamepad Mapping Enable Κουμπί B(κάτω)" ) MSG_HASH( MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_DOWN
GLdouble GLdouble GLdouble r
Definition: glext.h:6406
int mbedtls_mpi_gcd(mbedtls_mpi *G, const mbedtls_mpi *A, const mbedtls_mpi *B)
Greatest common divisor: G = gcd(A, B)
Definition: bignum.c:1815
int mbedtls_mpi_lset(mbedtls_mpi *X, mbedtls_mpi_sint z)
Set value from integer.
Definition: bignum.c:290
GLsizeiptr size
Definition: glext.h:6559
int mbedtls_mpi_fill_random(mbedtls_mpi *X, size_t size, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
Fill an MPI X with size bytes of random.
Definition: bignum.c:1871
GLdouble s
Definition: glext.h:6390
GLdouble GLdouble z
Definition: glext.h:6514
Unknown compiler Device disconnected from port File already exists Saving to backup buffer Got connection Public address Setting disk in tray You have left the game You have joined with input devices *s *s has joined as player u A netplay connection attempt failed because the peer is not running or is running an old version of RetroArch use the same version use the same version This core does not support inter architecture netplay Incorrect password A netplay client has disconnected You do not have permission to play The input devices requested are not available Netplay peer s paused Give hardware rendered cores their own private context Avoids having to assume hardware state changes inbetween frames Adjusts menu screen appearance settings Improves performance at the cost of latency and more video stuttering Use only if you cannot obtain full speed otherwise Autodetect Capabilities Connecting to port Password Username Accounts List Endpoint Achievements Scan Content Import content Ask Block Frames نظام تشغيل الصوت Audio Enable Turbo Deadzone Audio Maximum Timing Skew Audio Output Dynamic Audio Rate Control الصوت Audio Volume WASAPI Exclusive Mode WASAPI Shared Buffer Length Load Override Files Automatically Load Shader Presets Automatically Confirm Quit Scroll Up Toggle Keyboard Basic menu controls Info Scroll Up Toggle Keyboard Don t overwrite SaveRAM on loading savestate Buildbot Assets URL Allow Camera Cheat Cheat File Load Cheat File Cheat Passes Hardcore Mode Achievement Badges Locked Test Unofficial Achievements Unlocked Verbose Mode Config ملفات التكوين Collections Content Allow to remove entries Downloads Cheats Show core name Authors Core label Permissions System manufacturer Controls Options Start a Core Automatically Buildbot Cores URL Updater CPU Cursor Custom Ratio Database Selection Start directory< Default > Directory not found Disk Cycle Tray Status Disk Index Don t care Download Core DPI Override Enable أنظمة التشغيل Check for Missing Firmware Before Loading Dynamic Backgrounds Menu entry hover color False Favorites Limit Maximum Run Speed Frontend Counters Create game options file مساعدة Changing Virtual Gamepad Overlay مساعدة Scanning For Content History List Enable Horizontal Menu معلومات Analog To Digital Type Left Analog X Left analog Left Analog Y Left analog Y(down)") MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X
#define R(t)
GLboolean GLboolean GLboolean b
Definition: glext.h:6844
GLuint GLuint GLsizei count
Definition: glext.h:6292
int mbedtls_mpi_copy(mbedtls_mpi *X, const mbedtls_mpi *Y)
Copy the contents of Y into X.
Definition: bignum.c:180
int mbedtls_mpi_cmp_mpi(const mbedtls_mpi *X, const mbedtls_mpi *Y)
Compare signed values.
Definition: bignum.c:838
int mbedtls_mpi_set_bit(mbedtls_mpi *X, size_t pos, unsigned char val)
Set a bit of X to a specific value of 0 or 1.
Definition: bignum.c:319
int mbedtls_mpi_sub_mpi(mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *B)
Signed subtraction: X = A - B.
Definition: bignum.c:1038
int32_t mbedtls_mpi_sint
Definition: bignum.h:164
void mbedtls_mpi_swap(mbedtls_mpi *X, mbedtls_mpi *Y)
Swap the contents of X and Y.
Definition: bignum.c:214
int mbedtls_mpi_read_file(mbedtls_mpi *X, int radix, FILE *fin)
Read MPI from a line in an opened file.
Definition: bignum.c:600
int mbedtls_mpi_inv_mod(mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *N)
Modular inverse: X = A^-1 mod N.
Definition: bignum.c:1891
uint64_t mbedtls_t_udbl
Definition: bignum.h:167
int s
Definition: bignum.h:181
int mbedtls_mpi_read_string(mbedtls_mpi *X, int radix, const char *s)
Import from an ASCII string.
Definition: bignum.c:424
int mbedtls_mpi_get_bit(const mbedtls_mpi *X, size_t pos)
Get a specific bit from X.
Definition: bignum.c:308
int mbedtls_mpi_add_int(mbedtls_mpi *X, const mbedtls_mpi *A, mbedtls_mpi_sint b)
Signed addition: X = A + b.
Definition: bignum.c:1069
int mbedtls_mpi_safe_cond_swap(mbedtls_mpi *X, mbedtls_mpi *Y, unsigned char assign)
Safe conditional swap X <-> Y if swap is 1.
Definition: bignum.c:256
int mbedtls_mpi_mod_mpi(mbedtls_mpi *R, const mbedtls_mpi *A, const mbedtls_mpi *B)
Modulo: R = A mod B.
Definition: bignum.c:1453
#define A(i)
Definition: ecp_curves.c:884
int mbedtls_mpi_sub_abs(mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *B)
Unsigned subtraction: X = |A| - |B|.
Definition: bignum.c:964
GLfloat GLfloat p
Definition: glext.h:9809
signed int int32_t
Definition: stdint.h:123
uint32_t mbedtls_mpi_uint
Definition: bignum.h:165
int mbedtls_mpi_shift_r(mbedtls_mpi *X, size_t count)
Right-shift: X >>= count.
Definition: bignum.c:765
int mbedtls_mpi_exp_mod(mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *E, const mbedtls_mpi *N, mbedtls_mpi *_RR)
Sliding-window exponentiation: X = A^E mod N.
Definition: bignum.c:1607
#define FILE
Definition: file_stream_transforms.h:35
void mbedtls_mpi_init(mbedtls_mpi *X)
Initialize one MPI (make internal references valid) This just makes it ready to be set or freed,...
Definition: bignum.c:82
size_t n
Definition: bignum.h:182
MPI structure.
Definition: bignum.h:179
int mbedtls_mpi_mod_int(mbedtls_mpi_uint *r, const mbedtls_mpi *A, mbedtls_mpi_sint b)
Modulo: r = A mod b.
Definition: bignum.c:1476
int mbedtls_mpi_write_string(const mbedtls_mpi *X, int radix, char *buf, size_t buflen, size_t *olen)
Export into an ASCII string.
Definition: bignum.c:523
int mbedtls_mpi_self_test(int verbose)
Checkup routine.
Definition: bignum.c:2287
size_t mbedtls_mpi_size(const mbedtls_mpi *X)
Return the total size in bytes.
Definition: bignum.c:399
int mbedtls_mpi_safe_cond_assign(mbedtls_mpi *X, const mbedtls_mpi *Y, unsigned char assign)
Safe conditional assignement X = Y if assign is 1.
Definition: bignum.c:228
int mbedtls_mpi_add_abs(mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *B)
Unsigned addition: X = |A| + |B|.
Definition: bignum.c:887
signed __int64 int64_t
Definition: stdint.h:135
#define X(a, b)
Definition: bba.c:185
int mbedtls_mpi_cmp_abs(const mbedtls_mpi *X, const mbedtls_mpi *Y)
Compare unsigned values.
Definition: bignum.c:808
int mbedtls_mpi_cmp_int(const mbedtls_mpi *X, mbedtls_mpi_sint z)
Compare signed values.
Definition: bignum.c:871
int mbedtls_mpi_gen_prime(mbedtls_mpi *X, size_t nbits, int dh_flag, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
Prime number generation.
Definition: bignum.c:2182
#define __attribute__(Spec)
Definition: glslang_tab.cpp:647
int mbedtls_mpi_mul_mpi(mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *B)
Baseline multiplication: X = A * B.
Definition: bignum.c:1173
int mbedtls_mpi_mul_int(mbedtls_mpi *X, const mbedtls_mpi *A, mbedtls_mpi_uint b)
Baseline multiplication: X = A * b.
Definition: bignum.c:1210
int mbedtls_mpi_read_binary(mbedtls_mpi *X, const unsigned char *buf, size_t buflen)
Import X from unsigned binary data, big endian.
Definition: bignum.c:672
int mbedtls_mpi_write_binary(const mbedtls_mpi *X, unsigned char *buf, size_t buflen)
Export X into unsigned binary data, big endian. Always fills the whole buffer, which will start with ...
Definition: bignum.c:695
unsigned __int64 uint64_t
Definition: stdint.h:136
int mbedtls_mpi_shrink(mbedtls_mpi *X, size_t nblimbs)
Resize down, keeping at least the specified number of limbs.
Definition: bignum.c:144
unsigned int uint32_t
Definition: stdint.h:126
int mbedtls_mpi_sub_int(mbedtls_mpi *X, const mbedtls_mpi *A, mbedtls_mpi_sint b)
Signed subtraction: X = A - b.
Definition: bignum.c:1085
int mbedtls_mpi_is_prime(const mbedtls_mpi *X, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
Miller-Rabin primality test.
Definition: bignum.c:2150
size_t mbedtls_mpi_lsb(const mbedtls_mpi *X)
Return the number of zero-bits before the least significant '1' bit.
Definition: bignum.c:347
int mbedtls_mpi_shift_l(mbedtls_mpi *X, size_t count)
Left-shift: X <<= count.
Definition: bignum.c:715