A library for setting up Secure Socket Layer (SSL) connections and verifying remote hosts using certificates. Contains only the source files for mbed platform implementation of the library.
Dependents: HTTPClient-SSL HTTPClient-SSL HTTPClient-SSL HTTPClient-SSL
cyassl/ctaocrypt/mpi_superclass.h@0:b86d15c6ba29, 2015-01-19 (annotated)
- Committer:
- Vanger
- Date:
- Mon Jan 19 21:45:42 2015 +0000
- Revision:
- 0:b86d15c6ba29
Updated CyaSSL Library to 3.3.0. Changed Settings and functions to be implemented for mbed platforms
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Vanger | 0:b86d15c6ba29 | 1 | /* mpi_superclass.h |
Vanger | 0:b86d15c6ba29 | 2 | * |
Vanger | 0:b86d15c6ba29 | 3 | * Copyright (C) 2006-2014 wolfSSL Inc. |
Vanger | 0:b86d15c6ba29 | 4 | * |
Vanger | 0:b86d15c6ba29 | 5 | * This file is part of CyaSSL. |
Vanger | 0:b86d15c6ba29 | 6 | * |
Vanger | 0:b86d15c6ba29 | 7 | * CyaSSL is free software; you can redistribute it and/or modify |
Vanger | 0:b86d15c6ba29 | 8 | * it under the terms of the GNU General Public License as published by |
Vanger | 0:b86d15c6ba29 | 9 | * the Free Software Foundation; either version 2 of the License, or |
Vanger | 0:b86d15c6ba29 | 10 | * (at your option) any later version. |
Vanger | 0:b86d15c6ba29 | 11 | * |
Vanger | 0:b86d15c6ba29 | 12 | * CyaSSL is distributed in the hope that it will be useful, |
Vanger | 0:b86d15c6ba29 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
Vanger | 0:b86d15c6ba29 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
Vanger | 0:b86d15c6ba29 | 15 | * GNU General Public License for more details. |
Vanger | 0:b86d15c6ba29 | 16 | * |
Vanger | 0:b86d15c6ba29 | 17 | * You should have received a copy of the GNU General Public License |
Vanger | 0:b86d15c6ba29 | 18 | * along with this program; if not, write to the Free Software |
Vanger | 0:b86d15c6ba29 | 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
Vanger | 0:b86d15c6ba29 | 20 | */ |
Vanger | 0:b86d15c6ba29 | 21 | |
Vanger | 0:b86d15c6ba29 | 22 | |
Vanger | 0:b86d15c6ba29 | 23 | /* super class file for PK algos */ |
Vanger | 0:b86d15c6ba29 | 24 | |
Vanger | 0:b86d15c6ba29 | 25 | /* default ... include all MPI */ |
Vanger | 0:b86d15c6ba29 | 26 | #define LTM_ALL |
Vanger | 0:b86d15c6ba29 | 27 | |
Vanger | 0:b86d15c6ba29 | 28 | /* RSA only (does not support DH/DSA/ECC) */ |
Vanger | 0:b86d15c6ba29 | 29 | /* #define SC_RSA_1 */ |
Vanger | 0:b86d15c6ba29 | 30 | |
Vanger | 0:b86d15c6ba29 | 31 | /* For reference.... On an Athlon64 optimizing for speed... |
Vanger | 0:b86d15c6ba29 | 32 | |
Vanger | 0:b86d15c6ba29 | 33 | LTM's mpi.o with all functions [striped] is 142KiB in size. |
Vanger | 0:b86d15c6ba29 | 34 | |
Vanger | 0:b86d15c6ba29 | 35 | */ |
Vanger | 0:b86d15c6ba29 | 36 | |
Vanger | 0:b86d15c6ba29 | 37 | /* Works for RSA only, mpi.o is 68KiB */ |
Vanger | 0:b86d15c6ba29 | 38 | #ifdef SC_RSA_1 |
Vanger | 0:b86d15c6ba29 | 39 | #define BN_MP_SHRINK_C |
Vanger | 0:b86d15c6ba29 | 40 | #define BN_MP_LCM_C |
Vanger | 0:b86d15c6ba29 | 41 | #define BN_MP_PRIME_RANDOM_EX_C |
Vanger | 0:b86d15c6ba29 | 42 | #define BN_MP_INVMOD_C |
Vanger | 0:b86d15c6ba29 | 43 | #define BN_MP_GCD_C |
Vanger | 0:b86d15c6ba29 | 44 | #define BN_MP_MOD_C |
Vanger | 0:b86d15c6ba29 | 45 | #define BN_MP_MULMOD_C |
Vanger | 0:b86d15c6ba29 | 46 | #define BN_MP_ADDMOD_C |
Vanger | 0:b86d15c6ba29 | 47 | #define BN_MP_EXPTMOD_C |
Vanger | 0:b86d15c6ba29 | 48 | #define BN_MP_SET_INT_C |
Vanger | 0:b86d15c6ba29 | 49 | #define BN_MP_INIT_MULTI_C |
Vanger | 0:b86d15c6ba29 | 50 | #define BN_MP_CLEAR_MULTI_C |
Vanger | 0:b86d15c6ba29 | 51 | #define BN_MP_UNSIGNED_BIN_SIZE_C |
Vanger | 0:b86d15c6ba29 | 52 | #define BN_MP_TO_UNSIGNED_BIN_C |
Vanger | 0:b86d15c6ba29 | 53 | #define BN_MP_MOD_D_C |
Vanger | 0:b86d15c6ba29 | 54 | #define BN_MP_PRIME_RABIN_MILLER_TRIALS_C |
Vanger | 0:b86d15c6ba29 | 55 | #define BN_REVERSE_C |
Vanger | 0:b86d15c6ba29 | 56 | #define BN_PRIME_TAB_C |
Vanger | 0:b86d15c6ba29 | 57 | |
Vanger | 0:b86d15c6ba29 | 58 | /* other modifiers */ |
Vanger | 0:b86d15c6ba29 | 59 | #define BN_MP_DIV_SMALL /* Slower division, not critical */ |
Vanger | 0:b86d15c6ba29 | 60 | |
Vanger | 0:b86d15c6ba29 | 61 | /* here we are on the last pass so we turn things off. The functions classes are still there |
Vanger | 0:b86d15c6ba29 | 62 | * but we remove them specifically from the build. This also invokes tweaks in functions |
Vanger | 0:b86d15c6ba29 | 63 | * like removing support for even moduli, etc... |
Vanger | 0:b86d15c6ba29 | 64 | */ |
Vanger | 0:b86d15c6ba29 | 65 | #ifdef LTM_LAST |
Vanger | 0:b86d15c6ba29 | 66 | #undef BN_MP_TOOM_MUL_C |
Vanger | 0:b86d15c6ba29 | 67 | #undef BN_MP_TOOM_SQR_C |
Vanger | 0:b86d15c6ba29 | 68 | #undef BN_MP_KARATSUBA_MUL_C |
Vanger | 0:b86d15c6ba29 | 69 | #undef BN_MP_KARATSUBA_SQR_C |
Vanger | 0:b86d15c6ba29 | 70 | #undef BN_MP_REDUCE_C |
Vanger | 0:b86d15c6ba29 | 71 | #undef BN_MP_REDUCE_SETUP_C |
Vanger | 0:b86d15c6ba29 | 72 | #undef BN_MP_DR_IS_MODULUS_C |
Vanger | 0:b86d15c6ba29 | 73 | #undef BN_MP_DR_SETUP_C |
Vanger | 0:b86d15c6ba29 | 74 | #undef BN_MP_DR_REDUCE_C |
Vanger | 0:b86d15c6ba29 | 75 | #undef BN_MP_REDUCE_IS_2K_C |
Vanger | 0:b86d15c6ba29 | 76 | #undef BN_MP_REDUCE_2K_SETUP_C |
Vanger | 0:b86d15c6ba29 | 77 | #undef BN_MP_REDUCE_2K_C |
Vanger | 0:b86d15c6ba29 | 78 | #undef BN_S_MP_EXPTMOD_C |
Vanger | 0:b86d15c6ba29 | 79 | #undef BN_MP_DIV_3_C |
Vanger | 0:b86d15c6ba29 | 80 | #undef BN_S_MP_MUL_HIGH_DIGS_C |
Vanger | 0:b86d15c6ba29 | 81 | #undef BN_FAST_S_MP_MUL_HIGH_DIGS_C |
Vanger | 0:b86d15c6ba29 | 82 | #undef BN_FAST_MP_INVMOD_C |
Vanger | 0:b86d15c6ba29 | 83 | |
Vanger | 0:b86d15c6ba29 | 84 | /* To safely undefine these you have to make sure your RSA key won't exceed the Comba threshold |
Vanger | 0:b86d15c6ba29 | 85 | * which is roughly 255 digits [7140 bits for 32-bit machines, 15300 bits for 64-bit machines] |
Vanger | 0:b86d15c6ba29 | 86 | * which means roughly speaking you can handle upto 2536-bit RSA keys with these defined without |
Vanger | 0:b86d15c6ba29 | 87 | * trouble. |
Vanger | 0:b86d15c6ba29 | 88 | */ |
Vanger | 0:b86d15c6ba29 | 89 | #undef BN_S_MP_MUL_DIGS_C |
Vanger | 0:b86d15c6ba29 | 90 | #undef BN_S_MP_SQR_C |
Vanger | 0:b86d15c6ba29 | 91 | #undef BN_MP_MONTGOMERY_REDUCE_C |
Vanger | 0:b86d15c6ba29 | 92 | #endif |
Vanger | 0:b86d15c6ba29 | 93 | |
Vanger | 0:b86d15c6ba29 | 94 | #endif |
Vanger | 0:b86d15c6ba29 | 95 |