wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros | Typedefs
libtommath.c File Reference

Minimal code for RSA support from LibTomMath 0.41 http://libtom.org/ http://libtom.org/files/ltm-0.41.tar.bz2 This library was released in public domain by Tom St Denis. More...

Data Structures

struct  mp_int
 

Macros

#define CHAR_BIT   8
 
#define BN_MP_INVMOD_C
 
#define BN_S_MP_EXPTMOD_C
 
#define BN_S_MP_MUL_DIGS_C
 
#define BN_MP_INVMOD_SLOW_C
 
#define BN_S_MP_SQR_C
 
#define BN_S_MP_MUL_HIGH_DIGS_C
 
#define BN_MP_DIV_SMALL
 
#define BN_MP_INIT_MULTI_C
 
#define BN_MP_CLEAR_MULTI_C
 
#define BN_MP_ABS_C
 
#define LTM_NO_NEG_EXP
 
#define MIN(x, y)   ((x)<(y)?(x):(y))
 
#define MAX(x, y)   ((x)>(y)?(x):(y))
 
#define OPT_CAST(x)
 
#define DIGIT_BIT   28
 
#define MP_28BIT
 
#define XMALLOC   os_malloc
 
#define XFREE   os_free
 
#define XREALLOC   os_realloc
 
#define MP_MASK   ((((mp_digit)1)<<((mp_digit)DIGIT_BIT))-((mp_digit)1))
 
#define MP_LT   -1 /* less than */
 
#define MP_EQ   0 /* equal to */
 
#define MP_GT   1 /* greater than */
 
#define MP_ZPOS   0 /* positive integer */
 
#define MP_NEG   1 /* negative */
 
#define MP_OKAY   0 /* ok result */
 
#define MP_MEM   -2 /* out of mem */
 
#define MP_VAL   -3 /* invalid input */
 
#define MP_YES   1 /* yes response */
 
#define MP_NO   0 /* no response */
 
#define MP_LOW_MEM
 
#define MP_PREC   8 /* default digits of precision */
 
#define MP_WARRAY   (1 << (sizeof(mp_word) * CHAR_BIT - 2 * DIGIT_BIT + 1))
 
#define mp_iszero(a)   (((a)->used == 0) ? MP_YES : MP_NO)
 
#define mp_iseven(a)   (((a)->used > 0 && (((a)->dp[0] & 1) == 0)) ? MP_YES : MP_NO)
 
#define mp_isodd(a)   (((a)->used > 0 && (((a)->dp[0] & 1) == 1)) ? MP_YES : MP_NO)
 
#define s_mp_mul(a, b, c)   s_mp_mul_digs(a, b, c, (a)->used + (b)->used + 1)
 
#define TAB_SIZE   32
 

Typedefs

typedef unsigned long mp_digit
 
typedef u64 mp_word
 
typedef int mp_err
 

Detailed Description

Minimal code for RSA support from LibTomMath 0.41 http://libtom.org/ http://libtom.org/files/ltm-0.41.tar.bz2 This library was released in public domain by Tom St Denis.

The combination in this file may not use all of the optimized algorithms from LibTomMath and may be considerable slower than the LibTomMath with its default settings. The main purpose of having this version here is to make it easier to build bignum.c wrapper without having to install and build an external library.

If CONFIG_INTERNAL_LIBTOMMATH is defined, bignum.c includes this libtommath.c file instead of using the external LibTomMath library.

Macro Definition Documentation

#define BN_S_MP_EXPTMOD_C
Value:
/* Note: #undef in tommath_superclass.h; this would
* require BN_MP_EXPTMOD_FAST_C instead */
#define BN_S_MP_MUL_HIGH_DIGS_C
Value:
/* Note: #undef in tommath_superclass.h; this
* would require other than mp_reduce */