Lines Matching +full:- +full:y

4  * \brief Multi-precision integer library
8 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
24 #define MBEDTLS_ERR_MPI_FILE_IO_ERROR -0x0002
26 #define MBEDTLS_ERR_MPI_BAD_INPUT_DATA -0x0004
28 #define MBEDTLS_ERR_MPI_INVALID_CHARACTER -0x0006
30 #define MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL -0x0008
32 #define MBEDTLS_ERR_MPI_NEGATIVE_VALUE -0x000A
34 #define MBEDTLS_ERR_MPI_DIVISION_BY_ZERO -0x000C
36 #define MBEDTLS_ERR_MPI_NOT_ACCEPTABLE -0x000E
38 #define MBEDTLS_ERR_MPI_ALLOC_FAILED -0x0010
67 * Maximum size of MPIs allowed in bits and bytes for user-MPIs.
99 MBEDTLS_LN_2_DIV_LN_10_SCALE100 - 1) / \
103 * Define the base integer type, architecture-wise.
105 * 32 or 64-bit integer types can be forced regardless of the underlying
109 * Double-width integers (e.g. 128-bit in 64-bit architectures) can be
114 /* Always choose 64-bit when using MSC */
135 /* mbedtls_t_udbl defined as 128-bit unsigned int */
142 * __aarch64__ is only defined by armclang when compiling 64-bit code
151 /* mbedtls_t_udbl defined as 128-bit unsigned int */
156 /* Force 64-bit integers with unknown compiler */
164 /* Default to 32-bit compilation */
183 #error "Only 32-bit or 64-bit limbs are supported in bignum"
190 * is platform-dependent.
197 * is platform-dependent.
214 /** Sign: -1 if the mpi is negative, 1 otherwise.
217 * functions treat all-limbs-zero as equivalent to a valid representation
255 * in which case this function is a no-op. If it is
296 * \param Y The source MPI. This must point to an initialized MPI.
298 * \note The limb-buffer in the destination MPI is enlarged
305 int mbedtls_mpi_copy(mbedtls_mpi *X, const mbedtls_mpi *Y);
311 * \param Y The second MPI. It must be initialized.
313 void mbedtls_mpi_swap(mbedtls_mpi *X, mbedtls_mpi *Y);
321 * \param Y The MPI to be assigned from. This must point to an
325 * * \c 1: Perform the assignment `X = Y`.
329 * `if( assign ) mbedtls_mpi_copy( X, Y );`
337 * neither its original value nor the value in \p Y.
343 int mbedtls_mpi_safe_cond_assign(mbedtls_mpi *X, const mbedtls_mpi *Y, unsigned char assign);
350 * \param Y The second MPI. This must be initialized.
353 * * \c 1: Swap the values of \p X and \p Y.
354 * * \c 0: Keep the original values of \p X and \p Y.
357 * if( swap ) mbedtls_mpi_swap( X, Y );
364 * is indeterminate, and both \p X and \p Y might end up with
372 int mbedtls_mpi_safe_cond_swap(mbedtls_mpi *X, mbedtls_mpi *Y, unsigned char swap);
390 * \param pos Zero-based index of the bit to query.
406 * \param pos Zero-based index of the bit to modify.
419 * \note This is the same as the zero-based index of
433 * * \note This is same as the one-based index of the most
463 * \param s Null-terminated string buffer.
605 * \brief Perform a left-shift on an MPI: X <<= count
619 * \brief Perform a right-shift on an MPI: X >>= count
633 * \param X The left-hand MPI. This must point to an initialized MPI.
634 * \param Y The right-hand MPI. This must point to an initialized MPI.
636 * \return \c 1 if `|X|` is greater than `|Y|`.
637 * \return \c -1 if `|X|` is lesser than `|Y|`.
638 * \return \c 0 if `|X|` is equal to `|Y|`.
640 int mbedtls_mpi_cmp_abs(const mbedtls_mpi *X, const mbedtls_mpi *Y);
645 * \param X The left-hand MPI. This must point to an initialized MPI.
646 * \param Y The right-hand MPI. This must point to an initialized MPI.
648 * \return \c 1 if \p X is greater than \p Y.
649 * \return \c -1 if \p X is lesser than \p Y.
650 * \return \c 0 if \p X is equal to \p Y.
652 int mbedtls_mpi_cmp_mpi(const mbedtls_mpi *X, const mbedtls_mpi *Y);
657 * \param X The left-hand MPI. This must point to an initialized MPI
658 * with the same allocated length as Y.
659 * \param Y The right-hand MPI. This must point to an initialized MPI
662 * \c 1 if \p X is less than \p Y.
663 * \c 0 if \p X is greater than or equal to \p Y.
669 int mbedtls_mpi_lt_mpi_ct(const mbedtls_mpi *X, const mbedtls_mpi *Y,
675 * \param X The left-hand MPI. This must point to an initialized MPI.
679 * \return \c -1 if \p X is lesser than \p z.
699 * \brief Perform an unsigned subtraction of MPIs: X = |A| - |B|
728 * \brief Perform a signed subtraction of MPIs: X = A - B
757 * X = A - b
883 * \brief Perform a sliding-window exponentiation: X = A^E mod N
893 * speed-up multiple modular exponentiations for the same value
927 * as a big-endian representation of an MPI; this can
943 * \note There are `N - min` possible outputs. The lower bound
987 * \brief Compute the modular inverse: X = A^-1 mod N
1006 * \brief Miller-Rabin primality test.
1013 * if \p X is chosen uniformly or non-adversarially (as is the
1019 * \param rounds The number of bases to perform the Miller-Rabin primality
1021 * at most 2<sup>-2*\p rounds </sup>.
1042 MBEDTLS_MPI_GEN_PRIME_FLAG_DH = 0x0001, /**< (X-1)/2 is prime too */
1043 …_GEN_PRIME_FLAG_LOW_ERR = 0x0002, /**< lower error rate from 2<sup>-80</sup> to 2<sup>-128</sup> */