Commit Graph

53 Commits

Author SHA1 Message Date
toddouska
b6937626b4 don't require uneeded temp with WC_NO_CACHE_RESISTANT 2016-09-13 17:01:50 -07:00
toddouska
7b3fc558ec add WC_NO_CACHE_RESISTANT option for old code path 2016-09-13 16:45:15 -07:00
toddouska
46a0ee8e69 switch ecc timising resistant mulmod double to use temp instead of leaking key bit to cache monitor 2016-09-13 11:10:10 -07:00
toddouska
6ef9e79ff5 switch timing resistant exptmod to use temp for square instead of leaking key bit to cache monitor 2016-09-13 09:13:39 -07:00
toddouska
c2b55f69fa fix 32bit mp_add_d need 2016-07-18 12:49:31 -07:00
toddouska
d235a5f0cc add WC_RSA_BLINDING, wc_RsaSetRNG() for RSA Private Decrypt which doesn't have an RNG 2016-07-18 11:57:47 -07:00
David Garske
d294dc363e Fix scan-build warning with "redundant redeclaration of 'fp_isprime'". Changed "fp_isprime" and "fp_isprime_ex" to local static only. Also made "fp_gcd", "fp_lcm", and "fp_randprime" static functions. 2016-06-21 19:35:25 -07:00
David Garske
dd52af0872 ECC cleanup / fixes. Improvements to ECC with fast math enabled to avoid mp_clear on stack variables. Refactor of ECC failure cleanup (fixes possible mem leaks with small stack enabled). Refactor of "fp_is*" response checks to use FP_YES or FP_NO. Pulled libtom enhancement/cleanup of fp_isprime. Fix for compressed keys import with custom curves (still having some issues though). 2016-06-21 15:27:51 -07:00
David Garske
aa1a405dd1 Fixes for compressed keys. Fix to fast math "mp_cnt_lsb" to return proper value, which fixes "mp_jacobi", which fixes "mp_sqrtmod_prime", which fixes compressed keys for 224-bit key. Removed workarounds for compressed keys. Added new configure option "--enable-compkey". Fixed issue with normal math and custom curves where "t2" could be free'd and used. Fixed issue with mp_dump in integer.c, with not allocating correctly sized buffer for toradix. 2016-06-21 14:06:02 -07:00
David Garske
7c5483ba0b Performance improvements in fp_mulmod, fp_submod and fp_submod to handle ALT_ECC_SIZE better. Revert fp_clear to fp_add_d, since it isn't required and slows it down. 2016-06-15 08:41:51 -07:00
David Garske
5703e5eadb ECC changes to support custom curves. Added new "WOLFSSL_CUSTOM_CURVES" option to support non-standard ECC curves in ecc_is_point and ecc_projective_dbl_point. Refactor to load and pass curve "a" parameter down through ECC functions. Relocated mp_submod and added mp_addmod. Refactor to pass mp variable directly (not pointer) for montgomery variable. Fix in mp_jacobi to also handle case of a == 0. Cleanup of *_ecc_mulmod and wc_ecc_make_key_ex error handling. Cleanup of ecc_map for handling normal, fast and alt_ecc math for optimization of performance and allowing reduced ecc_size. 2016-06-15 08:41:51 -07:00
David Garske
87c00eb3f3 Math updates from libtom. Fixes in mp_read_radix for to include char 36 and clear the destination before checks. Fix to clear tmp value on fp_sub_d and fp_add_d. Fixes in assembly for x86-32 INNERMUL, PPC32 INNERMUL and PROPCARRY and x86-64 SQRADD. Added mp_isneg. Refactor of mp_iszero, mp_iseven, mp_isodd and mp_isneg to check using MP_YES or MP_NO. Changed fp_read_unsigned_bin "b" arg to const. Removal of the "register" on stack variables to let compiler determine best optimization. 2016-06-14 16:56:22 -07:00
David Garske
2ad9d41641 Performance improvement for fast math mp_clear to use fp_zero (memset) instead of fp_clear(ForceZero). Added new mp_forcezero function for clearing/free'ing sensitive private key data. Changed ECC and RSA to use mp_forcezero to explicitly handle private key clearing. 2016-05-12 11:50:34 -07:00
David Garske
1b602d783c Fast math correction of "sizeof" to use (). Updates to tfm and ecc comments. 2016-05-09 09:51:11 -07:00
David Garske
5cbc4bdf29 Added new "WOLFSSL_DEBUG_MATH", which enables use of "mp_dump" to display information about an mp_int. 2016-05-09 09:51:11 -07:00
David Garske
0ddbe0e60e Enhancement to RSA math function "_fp_exptmod" (non timing resistant version) to support WOLFSSL_SMALL_STACK, which moves the allocation of the 64 fp_int's from the stack to the heap. 2016-05-09 09:51:11 -07:00
David Garske
a5d27853fa Fixes to fp_mul and fp_div to clear any excess digits on the destination. Added compile-time check to confirm FP_SIZE is compatible with TFM_ acceleration defines enabled. Updated comments in other places where excess digits are cleared. 2016-05-09 09:51:11 -07:00
David Garske
7c3fbd7644 Fix for fp_copy() when used with ALT_ECC_SIZE so any excess digits on the destination that we didn't write to are set to zero. 2016-05-09 09:51:11 -07:00
Jacob Barthelmeh
e60adfc9da better naming of macro and alter misc.c check 2016-03-29 13:42:40 -06:00
Jacob Barthelmeh
2665db73a4 check for compiling misc.c when not needed 2016-03-28 16:03:15 -06:00
Jacob Barthelmeh
e99a5b0483 prepare for release v3.9.0 2016-03-17 16:02:13 -06:00
Jacob Barthelmeh
42219a327a refactor ForceZero of memory to gain performance 2016-02-04 10:31:05 -07:00
Jacob Barthelmeh
d0f8132cdc forcing sensitive memory to be all zeros when done with it 2016-02-01 10:45:09 -07:00
David Garske
f8876854f4 Spelling fixes in comments and error strings (ALGO_ID_E, ASN_TIME_E and WOLFSSL_ERROR function). 2016-01-29 16:13:09 -08:00
toddouska
8e97145682 fix coverity report for fp_mont reduce where m is half max size, not currently called that big but let's allow 2016-01-18 13:53:01 -08:00
kaleb-himes
c3a249009f allow openssl extra tests if configuration supports 2015-11-10 15:29:05 -07:00
toddouska
ad51d4ba09 make sure fast invmod lowers result in too big case 2015-10-02 15:38:22 -07:00
Takashi Kojo
f5ee6d616c Merge remote-tracking branch 'origin/MDK5' into MDK5 2015-08-29 21:24:44 +09:00
Takashi Kojo
6ff9f96809 inline to INLINE 2015-08-29 14:07:55 +09:00
Takashi Kojo
e459bb2e23 Fixed file access mode 2015-08-29 11:08:07 +09:00
toddouska
5e26a5c8fc fix alt_ecc_size exptmod with negative numbers 2015-08-27 11:18:06 -07:00
toddouska
3c614b5ba7 manual merge pull request #83, ALT_ECC_SIZE fix 2015-08-27 10:18:00 -07:00
Chris Conlon
5d40c5f566 Rename RNG to WC_RNG for Freescale, add NO_OLD_RNGNAME define to completely remove RNG type usage 2015-08-07 11:53:19 -06:00
kaleb-himes
121a24ba15 update logic for ECC FASTMATH KEY-GEN and COMP-KEY 2015-08-04 15:11:01 -06:00
Ludovic FLAMENT
8951d72f03 Merge branch 'master' of https://github.com/wolfSSL/wolfssl
Fix DSA key generation
2015-07-23 13:24:20 +02:00
Ludovic FLAMENT
349edd40c2 Add support for OpenSSH ssh-keygen tools
refactor existing code
2015-07-22 14:18:07 +02:00
Ludovic FLAMENT
702dbcf570 align return code, coding style (tab-> space, line with 80 char), curve_idx validity 2015-07-05 20:10:43 +02:00
toddouska
1a853d277d fix opensslextra w/o ecc ssh 2015-07-03 09:58:42 -07:00
toddouska
1d663d3bff merge conflict 2015-07-01 12:24:11 -07:00
toddouska
a62589f3fc add wc_ecc_check_key(), import validate option too 2015-06-16 11:29:27 -07:00
toddouska
6db33051d3 better detection of invalid ecc keys 2015-05-01 14:44:43 -07:00
Takashi Kojo
d8a6d9cffc runtime cpuflag for Intel MULX, cleaned in tfm.c 2015-04-06 10:34:07 +09:00
Takashi Kojo
b9aa7621e7 Intel MULX run time check in tfm.c 2015-04-02 15:42:38 +09:00
Takashi Kojo
a83e85b91e Intel mulx/adcx/adox 2015-03-29 10:20:30 +09:00
toddouska
3daa8369c7 allow XTOUPPER to work with macros that don't like signed types 2015-03-11 17:52:11 -07:00
John Safranek
f75329aa2e 1. Changed a memset to 0 of some mp_ints with mp_inits()
2. For alt-ecc, implemented the function fp_init_copy()
3. Added an fp_init() for the temp fp_int in fp_sub_d()
2015-01-30 09:03:44 -08:00
John Safranek
2e6d118a50 allow different sized fast math for both RSA and ECC
add C_EXTRA_FLAGS "-DALT_ECC_SIZE" to enable, and set
size with "-DFP_MAX_BITS_ECC=512", default is 512
2015-01-23 10:26:41 -08:00
kaleb-himes
a389620a29 Copyright (C) updates 2015-01-08 09:39:04 -07:00
Jacob Barthelmeh
95aad35e41 prunning on ctaocrypt files 2015-01-06 22:23:20 -07:00
Jacob Barthelmeh
9e2ae79c8a include in tfm and compatability for random and sha256 2015-01-05 16:36:24 -07:00