tommath_superclass.h

Go to the documentation of this file.
00001 /* super class file for PK algos */
00002 
00003 /* default ... include all MPI */
00004 #define LTM_ALL
00005 
00006 /* RSA only (does not support DH/DSA/ECC) */
00007 /* #define SC_RSA_1 */
00008 
00009 /* For reference.... On an Athlon64 optimizing for speed...
00010 
00011    LTM's mpi.o with all functions [striped] is 142KiB in size.
00012 
00013 */
00014 
00015 /* Works for RSA only, mpi.o is 68KiB */
00016 #ifdef SC_RSA_1
00017    #define BN_MP_SHRINK_C
00018    #define BN_MP_LCM_C
00019    #define BN_MP_PRIME_RANDOM_EX_C
00020    #define BN_MP_INVMOD_C
00021    #define BN_MP_GCD_C
00022    #define BN_MP_MOD_C
00023    #define BN_MP_MULMOD_C
00024    #define BN_MP_ADDMOD_C
00025    #define BN_MP_EXPTMOD_C
00026    #define BN_MP_SET_INT_C
00027    #define BN_MP_INIT_MULTI_C
00028    #define BN_MP_CLEAR_MULTI_C
00029    #define BN_MP_UNSIGNED_BIN_SIZE_C
00030    #define BN_MP_TO_UNSIGNED_BIN_C
00031    #define BN_MP_MOD_D_C
00032    #define BN_MP_PRIME_RABIN_MILLER_TRIALS_C
00033    #define BN_REVERSE_C
00034    #define BN_PRIME_TAB_C
00035 
00036    /* other modifiers */
00037    #define BN_MP_DIV_SMALL                    /* Slower division, not critical */
00038 
00039    /* here we are on the last pass so we turn things off.  The functions classes are still there
00040     * but we remove them specifically from the build.  This also invokes tweaks in functions
00041     * like removing support for even moduli, etc...
00042     */
00043 #ifdef LTM_LAST
00044    #undef  BN_MP_TOOM_MUL_C
00045    #undef  BN_MP_TOOM_SQR_C
00046    #undef  BN_MP_KARATSUBA_MUL_C
00047    #undef  BN_MP_KARATSUBA_SQR_C
00048    #undef  BN_MP_REDUCE_C
00049    #undef  BN_MP_REDUCE_SETUP_C
00050    #undef  BN_MP_DR_IS_MODULUS_C
00051    #undef  BN_MP_DR_SETUP_C
00052    #undef  BN_MP_DR_REDUCE_C
00053    #undef  BN_MP_REDUCE_IS_2K_C
00054    #undef  BN_MP_REDUCE_2K_SETUP_C
00055    #undef  BN_MP_REDUCE_2K_C
00056    #undef  BN_S_MP_EXPTMOD_C
00057    #undef  BN_MP_DIV_3_C
00058    #undef  BN_S_MP_MUL_HIGH_DIGS_C
00059    #undef  BN_FAST_S_MP_MUL_HIGH_DIGS_C
00060    #undef  BN_FAST_MP_INVMOD_C
00061 
00062    /* To safely undefine these you have to make sure your RSA key won't exceed the Comba threshold
00063     * which is roughly 255 digits [7140 bits for 32-bit machines, 15300 bits for 64-bit machines] 
00064     * which means roughly speaking you can handle upto 2536-bit RSA keys with these defined without
00065     * trouble.  
00066     */
00067    #undef  BN_S_MP_MUL_DIGS_C
00068    #undef  BN_S_MP_SQR_C
00069    #undef  BN_MP_MONTGOMERY_REDUCE_C
00070 #endif
00071 
00072 #endif
00073 
00074 /* $Source: /cvsroot/tcl/libtommath/tommath_superclass.h,v $ */
00075 /* $Revision: 1.3 $ */
00076 /* $Date: 2005/09/26 18:27:14 $ */



Generated on Wed Mar 12 12:18:25 2008 by  doxygen 1.5.1