aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Implement const time select based on xor-swapJack Lloyd2018-11-231-1/+2
| | | | | For some compilers this may make the difference between compiling using bitmasks as intendeded, and compiling with a conditional jump.
* In operator>> avoid testing for zero unless requiredJack Lloyd2018-11-231-1/+1
|
* Simplify Salsa20 xor loopJack Lloyd2018-11-211-4/+7
|
* Build docs last in makefile targetJack Lloyd2018-11-211-1/+1
| | | | Closes #1746
* Fix type errorJack Lloyd2018-11-211-1/+1
| | | | Closes #1747
* Slight simplification to ChaCha loopJack Lloyd2018-11-211-7/+13
|
* When available use RDRAND for Stateful_RNG additional dataJack Lloyd2018-11-211-4/+19
|
* Use builtin_bswap16 when availableJack Lloyd2018-11-201-0/+4
|
* Merge GH #1743 Avoid memset/memcpy in library codeJack Lloyd2018-11-1920-58/+84
|\
| * Add typecast_copyJack Lloyd2018-11-173-30/+48
| | | | | | | | | | Wraps memcpy in the cases where we really are doing a type conversion using memcpy
| * Avoid calling memset, memcpy within library codeJack Lloyd2018-11-1717-27/+36
| | | | | | | | | | | | | | | | | | Prefer using wrappers in mem_utils for this. Current exception is where memcpy is being used to convert between two different types, since copy_mem requires input and output pointers have the same type. There should be a new function to handle conversion-via-memcpy operation.
| * Remove needless memset operationJack Lloyd2018-11-171-1/+0
| |
* | Avoid a crank from Sonar [ci skip]Jack Lloyd2018-11-171-1/+1
|/
* Disable Sonar buildJack Lloyd2018-11-171-5/+5
| | | | | | | | | | | | It is suddenly 5x slower for an unknown reason https://community.sonarsource.com/t/sonar-analysis-step-suddenly-much-5x-slower-on-travis-ci/4364 Now it either times out or else completely dominates the runtime for Travis, either is not acceptable. Leave the framework for using Sonar in CI for now so it is easy to test if things have improved later. If things are still broken in a month or two I'll probably just drop support for Sonar.
* Fix Sonar warningJack Lloyd2018-11-171-1/+1
|
* Attempt to fix Sonar build problemJack Lloyd2018-11-172-1/+8
| | | | | | The build is timing out. Use -Os instead of -O3 in an attempt to speed up the build step, and enable multithreaded analysis as that step is also quite slow.
* Use vzeroupper/vzeroall to transition between AVX and SSE states.Jack Lloyd2018-11-104-0/+32
| | | | | | | | Otherwise some CPUs suffer serious stalls. Using vzeroall on exit also has the nice effect that we don't have to worry about register contents leaking. HT to @noloader for doing the background research on this.
* Avoid an implausible integer overflow flagged by Coverity [ci skip]Jack Lloyd2018-11-101-1/+6
|
* Avoid branching in the NIST prime reduction codeJack Lloyd2018-11-092-59/+58
| | | | | This is still vulnerable to a cache-based side channel since the multiple chosen leaks the final carry.
* Merge GH #1737 Inline mp_coreJack Lloyd2018-11-094-604/+439
|\
| * Use resize instead of shrink_to_fitJack Lloyd2018-11-092-3/+10
| | | | | | | | Avoid recalculating significant words which slows down reduction
| * Inline the contents of mp_core.cppJack Lloyd2018-11-092-601/+429
| |
* | Bump ABI versionJack Lloyd2018-11-091-1/+1
| | | | | | | | BigInt has changed size
* | Cleanups in Poly1305Jack Lloyd2018-11-091-23/+23
|/
* Merge GH #1734 Refactor BigInt data model, add sig_words cacheJack Lloyd2018-11-093-107/+253
|\
| * Optimize mod_subJack Lloyd2018-11-091-10/+21
| | | | | | | | | | We already assumed the args are < modulus so we can avoid the call to sig_words. This provides a noticable speedup for ECDSA overall.
| * Add a cache of sig words to BigIntJack Lloyd2018-11-093-97/+232
| |
* | Rename get_uint32_t to get_uint32Jack Lloyd2018-11-091-67/+67
| |
* | Run RSA blinding tests only with base providerAlexander Bluhm2018-11-081-2/+9
|/ | | | | Only the base provider uses blinding for RSA. So the test should run exclusively for this provider. Also use base provider explicitly.
* Add some missing includesJack Lloyd2018-11-088-0/+9
| | | | This is not exhaustive. See GH #1733
* Switch LibreSSL provider to OpenSSL 1.1 APIAlexander Bluhm2018-11-073-6/+6
| | | | | | | LibreSSL 2.7 has added parts of the OpenSSL 1.1 API. Remove the defined(LIBRESSL_VERSION_NUMBER) as it is not necessary anymore. Switch to the newer API unconditionally, older LibreSSL version are not supported.
* Compile fixJack Lloyd2018-11-072-1/+2
|
* Avoid throwing std:: exceptionsJack Lloyd2018-11-073-2/+3
| | | | | Also include <new> in mem_ops.cpp as apparently that header is where bad_alloc is defined.
* Avoid using std::invalid_argumentJack Lloyd2018-11-073-4/+4
| | | | See #1726
* Add missing <stdexcept> <string> necessaryLarry-Hu2018-11-072-2/+2
|
* Simplify BigInt::is_zeroJack Lloyd2018-11-061-6/+1
| | | | | | The definition of return value of sig_words() means the integer is zero iff sig_words() returns zero, so there is no reason to scan over the data twice.
* Merge GH #1730 Optimize AVX2 ChaChaJack Lloyd2018-11-062-238/+209
|\
| * Optimize AVX2 ChaChaJack Lloyd2018-11-052-238/+209
| | | | | | | | | | | | Using the same transposition trick used for SSE2 in #1728 On my Skylake desktop about 5-10% faster depending on buffer sizes.
* | Merge GH #1729 Optimize SIMD_4x32 for NEONJack Lloyd2018-11-061-33/+32
|\ \
| * | Fix for 32-bit ARMJack Lloyd2018-11-051-0/+9
| | |
| * | Some optimizations for NEON in SIMD_4x32Jack Lloyd2018-11-051-35/+25
| |/
* / Remove SIMD_32 typedefJack Lloyd2018-11-054-50/+48
|/ | | | | It is confusing since its not clear from the name how many elements it has, and this gives consistency with SIMD_8x32 type.
* Add ChaCha using SIMD_4x32Jack Lloyd2018-11-0414-612/+279
| | | | | | | | | | | This allows supporting SSE2, NEON and AltiVec in a single codebase, so drop the NEON and SSE2 code. This new impl avoids having to do shuffles with every round and so is about 10% faster on Skylake. Also, fix bugs in both baseline and AVX2 implementations when the low counter overflowed. The SSE2 and NEON code were also buggy here.
* Use 64-bit integer for seek value in stream cipher testsJack Lloyd2018-11-041-1/+1
|
* Add VarMap::get_opt_u64Jack Lloyd2018-11-042-8/+25
|
* Ensure this works even if par mult param is set to 1Jack Lloyd2018-11-021-1/+1
| | | | As this paramater is technically a user configurable toggle.
* Correct testJack Lloyd2018-11-024-3/+18
| | | | This was trying to test for issue in #1723 but was incorrect.
* Merge GH #1724 Increase update granularity of GCM to work around FFI problemJack Lloyd2018-11-021-1/+1
|\
| * Fixed an issue where update_granularity is equal to tag_size in GCM mode, ↵chux05192018-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | which will cause incremental decoding to fail in ffi. related code(ffi_cipher.cpp): ```cpp BOTAN_ASSERT(cipher.update_granularity() > cipher.minimum_final_size(), "logic error"); ```
* | Add missing <stdexcept> <string> necessaryCheney-Wang2018-11-021-0/+2
|/