aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils
Commit message (Collapse)AuthorAgeFilesLines
* Simplify polynomial doubling codeJack Lloyd2017-09-052-105/+65
| | | | | | | | | | GCC and Clang generate effectively identical code for a template with parameters, vs completely unrolled code as was used previously. Add a little-endian variant so XTS can use it. This extends XTS support to cover 256 and 512-bit ciphers. I was not able to find another implementation that supports both XTS and ciphers with large blocks, so the XTS test vectors are self-generated.
* Header shuffleJack Lloyd2017-09-041-5/+10
| | | | Still need basic system headers even when using asio for network
* MinGW fixesJack Lloyd2017-09-042-4/+4
|
* Merge GH #1180 Refactorings to support Windows PhoneJack Lloyd2017-09-035-179/+330
|\
| * TypoJack Lloyd2017-09-031-1/+1
| |
| * Define macro so windows.h doesn't include winsock.hJack Lloyd2017-09-031-0/+1
| | | | | | | | Ugh Windows headers y u so nasty.
| * Move secure_scrub_memory to os_utils.cppJack Lloyd2017-09-032-40/+27
| |
| * Refactor network code used in http_utilJack Lloyd2017-09-033-140/+303
| | | | | | | | Move the actual socket stuff to os_utils.cpp
* | Cleanups in cpuid handling codeJack Lloyd2017-09-031-47/+47
|/
* Merge GH #1169 Add LLVM bitcode targetJack Lloyd2017-08-312-2/+2
|\
| * Add support for LLVM bitcode targetJack Lloyd2017-08-302-2/+2
| |
* | Fix various MSVC warningsJack Lloyd2017-08-315-34/+46
|/ | | | Based on VC2017 output
* Avoid using GCC ivdep pragma in GCC 4.8 [ci skip]Jack Lloyd2017-08-281-1/+1
|
* Fix bug affecting AltiVec on ppc64le processorsJack Lloyd2017-08-231-8/+2
|
* Fix Altivec detectionJack Lloyd2017-08-221-2/+2
| | | | Broken in c3ae43c04c
* Merge GH #1151 Add SHACAL2Jack Lloyd2017-08-151-0/+58
|\
| * Add SHACAL2 in generic SIMDJack Lloyd2017-08-131-0/+58
| | | | | | | | Bit over 2x faster on my desktop
* | Improve polynomial doubling code, move to utilJack Lloyd2017-08-153-0/+155
|/ | | | | | | | | Now does 64-bits at a time instead of 8 bits, and avoids conditional timing channel on the XOR carry. Confirmed that at least GCC 7 and Clang 4 on x86-64 compile the functions without conditional jumps. Also removes CMAC as a dependency of OCB, which only needed it in order to call CMAC::poly_double
* Use anonymous namespace to fix static buildRené Korthaus2017-08-041-0/+4
|
* Add support for Windows sockets to http_utilRené Korthaus2017-08-042-1/+50
| | | | | | Based on the work by @slicer4ever, adds support for Windows sockets to http_util. As a bonus, we get Windows support for tls_client and tls_server CLI.
* Change how CPU endianness is detected.Jack Lloyd2017-08-032-17/+34
| | | | | | | | | | | | | This is kind of an artificial change to appease Coverity but maybe a bit cleaner in any case. The issue is Coverity detects the throw in the case of PDP endian being found at runtime, and assumes it might happen. And since OS::get_processor_timestamp calls CPUID on x86 (to check for RDTSC), it might throw. And so on up the call chain until it detect a throw escaping from ~Timer_Scope in speed.cpp, which would crash. However I do not have a PDP-endian x86 around to confirm this ... :)
* Allow bit rotation by more than sizeof(T)*8 bits.Daniel Wyatt2017-06-281-0/+2
| | | | | | | | | Currently these functions will happily bit shift by >= sizeof(T)*8 bits. However, this is undefined behavior, and results in unexpected results (0) on at least one platform I've tested. With this update, you can expect that rotate_left<uint32_t>(1, 32)==1 and rotate_right<uint32_t>(1, 32)==1.
* Merge GH #1017 Complete wildcard handling for X.509 certificatesJack Lloyd2017-04-271-4/+84
|\
| * Complete wildcard handling for X.509 certificatesRené Korthaus2017-04-201-4/+84
| | | | | | | | | | | | | | | | | | | | | | | | Hostname validation is used to make sure the certificate hostname matches the hostname of the connected host. RFC 6125 allows one wildcard in the left-most label of a hostname. Up to now, we only supported only the wildcard as the left-most label, e.g., www.example.com would match *.example.com, but www.example.com would not match www*.example.com, although it is permitted. Also adds test vectors from RFC 6125 as well as the OpenSSL test suite.
* | Add BOTAN_ALIGNAS macro for MSVC 2013Jack Lloyd2017-04-271-0/+9
|/ | | | GH #1009
* Let BOTAN_UNUSED take between 1 and 9 argumentsSimon Warta2017-04-161-2/+26
|
* Fix X509 DN comparisonsJack Lloyd2017-04-041-0/+2
| | | | CVE-2017-2801
* Merge GH #974 Add wrapper for make_uniqueJack Lloyd2017-04-042-0/+78
|\
| * add Botan::make_uniqueTomasz Frydrych2017-04-042-0/+78
| |
* | Content:Tomasz Frydrych2017-04-031-2/+2
|/ | | | | | | | | * fixes for deprecated constructions in c++11 and later (explicit rule of 3/5 or implicit rule of 0 and other violations) * `default` specifier instead of `{}` in some places(probably all) * removal of unreachable code (for example `return` after `throw`) * removal of compilation unit only visible, but not used functions * fix for `throw()` specifier - used instead `BOTAN_NOEXCEPT` * removed not needed semicolons
* Remove "Dirty hack" for multiple defines in lex_me_harder()Simon Warta2017-04-026-10/+20
|
* Fix some compiler warnings.Jack Lloyd2017-03-221-1/+1
|
* Fix #917: calendar_point::to_std_timepoint() does not support years after 2037Daniel Neus2017-03-211-3/+4
| | | | Only throw on systems where 32 bit std::time_t is used.
* No C++ exceptions from cpu probe functions. See GH #920Jack Lloyd2017-03-192-26/+11
|
* Fix further compiler macro bug exposed by #921Jack Lloyd2017-03-191-1/+1
|
* BOTAN_TARGET_COMPILER_IS -> BOTAN_BUILD_COMPILER_ISDaniel Neus2017-03-151-1/+1
|
* Resolve Doxygen error in cpuid.hJack Lloyd2017-02-111-1/+2
| | | | The macro has to be on its own line or Doxygen gets confused.
* Merge GH #860 Support CPU instruction probe on Windows, add ↵Jack Lloyd2017-01-312-37/+74
|\ | | | | | | OS::get_high_resolution_clock
| * Fix missing return in Windows pathJack Lloyd2017-01-301-7/+3
| |
| * Change meaning of get_processor_timestampJack Lloyd2017-01-272-36/+77
| | | | | | | | | | | | | | | | | | | | | | Now let it return 0 if we have no hardware timestamp, and add OS::get_high_resolution_clock for best available clock. This is mainly because it's confusing for get_processor_timestamp to return something that is not a processor timestamp and because it simplifies adding cycles/byte output if we know that something is or is not a cycle counter. Also adds Windows SEH version of run_cpu_instruction_probe. Untested, uncompiled.
* | Blind fixJack Lloyd2017-01-301-1/+1
| |
* | Transpose for 32-bit NEONJack Lloyd2017-01-291-1/+19
| | | | | | | | Different intrinsics API
* | Workaround for MSVC 2013Jack Lloyd2017-01-292-3/+14
| |
* | Set SIMD ISA flags when building test_simd.cppJack Lloyd2017-01-291-1/+6
| | | | | | | | Return NEON from CPUID::has_simd_32
* | Add support for NEON in SIMD_4x32Jack Lloyd2017-01-292-191/+352
|/ | | | Tested on qemu-aarch64
* Fix various SunCC and Solaris warnings and build problems.Jack Lloyd2017-01-242-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | Based on build output sent by @noloader. If RLIMIT_MEMLOCK is not defined, assume regular user is not able to call mlock. This probably also affected Clang/GCC on Solaris. Work around resolution issue in SIMD_4x32 where it finds ambiguity between arg taking uint32_t and __m128i. This is probably some artifact of how SunCC represents vector types, and seems highly bogus in general but is easy to work around here. Change constructor taking a single value to instead be `SIMD_4x32::splat` function. The SIMD class is internal, so no API implications. Fix various warnings about lambda functions that were missing return types and which were not a single return statement. AIUI C++11 doesn't guarantee that lambda return type will be deduced in that situation, though in practice every compiler including SunCC seems to handle it. Disable AVX2 usage, since SunCC's intrinsics seem to be broken - its _mm_loadu_si256 takes non-const pointer. Rename a few variables in the tests to avoid shadowed var warnings.
* Remove obsolete workaround for bug in some old Sun Studio versionJack Lloyd2017-01-241-5/+0
| | | | [ci skip]
* If PowerPC clock returns 0, skip it.Jack Lloyd2017-01-231-2/+10
| | | | | | Doesn't seem to be a problem with the asm, code works fine on physical hardware (POWER8) but on qemu (on CI) both instructions return zero and the test fails.
* Add CPUID::to_stringJack Lloyd2017-01-222-38/+67
| | | | | | | | | Deprecates CPUID::print, mainly to avoid use of ostream in utils. Main reasoning is some platforms do not have streams at all. If all uses of streams are for operator<< and operator>> overloads, these can be guarded by a future BOTAN_HAS_CPP_STREAMS system-feature flag. But when ostreams are required to use the API (as here), that is not possible.
* Add basic test for OS utilsJack Lloyd2017-01-221-4/+12
| | | | | Mainly driven by missing test for OS::run_cpu_instruction_probe. Currently only works on x86 and ARM. Tested on x86-64 native and aarch64 qemu.