22 #ifndef __WOLFMATH_H__ 23 #define __WOLFMATH_H__ 29 #ifdef WOLFSSL_PUBLIC_MP 30 #define MP_API WOLFSSL_API 32 #define MP_API WOLFSSL_LOCAL 36 #define MIN(x,y) ((x)<(y)?(x):(y)) 40 #define MAX(x,y) ((x)>(y)?(x):(y)) 44 #if !defined(WC_NO_CACHE_RESISTANT) && \ 45 ((defined(HAVE_ECC) && defined(ECC_TIMING_RESISTANT)) || \ 46 (defined(USE_FAST_MATH) && defined(TFM_TIMING_RESISTANT))) 48 extern const wolfssl_word wc_off_on_addr[2];
53 MP_API
int get_digit_count(
mp_int* a);
54 MP_API mp_digit get_digit(
mp_int* a,
int n);
55 MP_API
int get_rand_digit(
WC_RNG* rng, mp_digit* d);
57 WOLFSSL_API
int mp_cond_copy(
mp_int* a,
int copy,
mp_int* b);
58 WOLFSSL_API
int mp_rand(
mp_int* a,
int digits,
WC_RNG* rng);
63 WC_TYPE_UNSIGNED_BIN = 2,
66 WOLFSSL_API
int wc_export_int(
mp_int* mp, byte* buf, word32* len,
67 word32 keySz,
int encType);
69 #ifdef HAVE_WOLF_BIGINT 70 #if !defined(WOLF_BIGINT_DEFINED) 77 #define WOLF_BIGINT_DEFINED 80 WOLFSSL_LOCAL
void wc_bigint_init(
WC_BIGINT* a);
81 WOLFSSL_LOCAL
int wc_bigint_alloc(
WC_BIGINT* a, word32 sz);
82 WOLFSSL_LOCAL
int wc_bigint_from_unsigned_bin(
WC_BIGINT* a,
const byte* in, word32 inlen);
83 WOLFSSL_LOCAL
int wc_bigint_to_unsigned_bin(
WC_BIGINT* a, byte* out, word32* outlen);
84 WOLFSSL_LOCAL
void wc_bigint_zero(
WC_BIGINT* a);
85 WOLFSSL_LOCAL
void wc_bigint_free(
WC_BIGINT* a);
88 WOLFSSL_LOCAL
int wc_mp_to_bigint_sz(
mp_int* src,
WC_BIGINT* dst, word32 sz);
Definition: integer.h:200
Definition: integer.h:191