aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
Commit message (Collapse)AuthorAgeFilesLines
* Renamed m_handle to m_prov as this is the variable name used elsewhere.Ricardo Martins2019-02-151-1/+1
|
* Support arbitrary key lengths in SHAKE-128 cipherJack Lloyd2019-02-132-22/+14
| | | | | We need this for Kyber, which uses 34 byte inputs to XOF when computing the public matrix.
* Build fixes for GNU/HurdJack Lloyd2019-02-041-0/+1
| | | | Thanks to @noloader for testing this and the relevant info.
* Merge GH #1819 Add Thread_Pool and use it for running testsJack Lloyd2019-01-315-14/+212
|\
| * Add a thread poolJack Lloyd2019-01-315-14/+212
| |
* | Have set_mem only work for bytesJack Lloyd2019-01-311-4/+3
| | | | | | | | It is (mildly) dangerous with larger types, and we don't need it.
* | Minor HMAC optimizationsJack Lloyd2019-01-312-15/+31
|/ | | | | Most importantly, avoid an allocation when the key is larger than a block size. Also avoid some virtual calls that can be cached.
* Merge GH #1821 Refactor CPUID to be thread safeJack Lloyd2019-01-317-54/+83
|\
| * Refactor CPUID to make it thread safeJack Lloyd2019-01-307-54/+83
| | | | | | | | | | | | | | | | | | | | Needed for #1819 and unfortunately Windows does not allow thread local data to be stored as a member of a DLL exported class. So hide it behind an accessor function instead. This slows down CPUID test somewhat and I would like to address that but it seems hard without breaking the CPUID API, which is for better or worse public.
* | Recognize BLAKE2b also [ci skip]Jack Lloyd2019-01-311-1/+1
|/ | | | See #1822
* Compile fixJack Lloyd2019-01-302-2/+2
|
* Use std::mutex instead of mutex_type hereJack Lloyd2019-01-304-8/+8
| | | | | std::condition_variable only works with std::mutex anyway, and this module is not enabled on systems without threads.
* Avoid a harmless data race in RSA decryptionJack Lloyd2019-01-281-0/+7
| | | | | | | | | Both threads called Modular_Reducer::reduce on m, which caused the significant words result to be written twice in an unsynchronized way. By calling it once beforehand it is computed and cached and so no additional writes occur. Found with helgrind.
* Fix warningJack Lloyd2019-01-241-3/+6
|
* Doc updatesJack Lloyd2019-01-241-1/+3
|
* Revamp BigInt encoding and decoding.Jack Lloyd2019-01-245-104/+131
| | | | Deprecate some crufty functions. Optimize binary encoding/decoding.
* Make the Memory_Pool MMU operations a compile time optionJack Lloyd2019-01-221-4/+16
| | | | | | Previously the calls were commented out as this has a substantial performance impact. Allow enabling them via a build.h toggle, and enable it by default when debug asserts are turned on.
* Remove some unnecessary assertsJack Lloyd2019-01-223-34/+0
| | | | Now this is checked at the higher level
* Merge GH #1816 Rename Integrity_Failure to Invalid_Authentication_TagJack Lloyd2019-01-2121-33/+50
|\
| * Rename Integrity_Failure to Invalid_Authentication_TagJack Lloyd2019-01-1821-33/+50
| | | | | | | | | | | | | | | | | | This makes the meaning and usage more clear. Add a specific error type so invalid tags can be distinguished without having to catch that specific type. See also #1813
* | Add BMI2 variants for SHA-512 and SHA-3Jack Lloyd2019-01-1810-10/+413
|/ | | | Both about 33% faster on Skylake
* Fix init ordering warningJack Lloyd2019-01-181-1/+1
|
* Remove use of std::filesystem / boost::filesystemJack Lloyd2019-01-172-69/+8
| | | | | | | | | Boost doesn't buy us anything here since we need to maintain Win32 and POSIX implementations for non-Boost builds, and Boost only supports those two APIs anyway. MSVC's implementation of std::filesystem does not help for similar reasons, as we have to maintain a Win32 version for MinGW.
* Define BOTAN_IF_CONSTEXPRJack Lloyd2019-01-174-8/+25
| | | | This lets us avoid some warnings under VC++ 2017
* Fix some warnings from PVS-StudioJack Lloyd2019-01-1711-14/+23
| | | | No real bugs, but pointed out some odd constructs and duplicated logic
* Merge GH #1808 Add sandbox feature to CLIJack Lloyd2019-01-141-0/+1
|\
| * Sandboxing feature from CLI pov.David Carlier2019-01-142-24/+0
| | | | | | | | | | No resources to free with actual OS features but might be of use for later.
| * Proposal of sandboxing feature.David Carlier2019-01-062-0/+25
| | | | | | | | For now only used by the TLS server.
* | Remove unused fieldsJack Lloyd2019-01-131-3/+0
| |
* | Remove trailing whitespaceJack Lloyd2019-01-1312-57/+55
|/
* Fix indent [ci skip]Jack Lloyd2019-01-051-7/+7
|
* Revert #1798Jack Lloyd2019-01-051-4/+14
| | | | | | | | The problem in #602 is not the use of mmap but the use of mmap with MAP_SHARED. Using MAP_PRIVATE creates a CoW mapping just like malloc or posix_memalign would. I'm not sure why it took me so long to figure this out ...
* Add a fast range check and inline some thingsJack Lloyd2019-01-052-78/+89
|
* Split up allocations into pagesJack Lloyd2019-01-056-169/+188
|
* New Memory_Pool implementationJack Lloyd2019-01-043-131/+335
| | | | | Quite a bit faster than the old version, and with better properties wrt alignment
* Some cleanups in McEliece keygenJack Lloyd2019-01-031-15/+17
| | | | Lots more of this needed in here
* Add cast for MSVCJack Lloyd2019-01-031-1/+4
|
* Use memcpy instead of strcpy here to shut up MSVC warningJack Lloyd2019-01-031-1/+1
| | | | Here the caller is assumed to have provided a buffer of sufficient size.
* Add VC 2019 preview buildJack Lloyd2019-01-023-2/+2
|
* Merge GH #1803 XLC fixesJack Lloyd2019-01-015-11/+19
|\
| * Fix use of macroJack Lloyd2018-12-311-1/+1
| | | | | | | | Assumed to be 0/1
| * Clean up define for inline asmJack Lloyd2018-12-312-3/+7
| | | | | | | | Also fix xlc macro
| * Use __builtin_bswapN builtins on XLCJack Lloyd2018-12-311-4/+4
| | | | | | | | Recent XLC is based on clang and has these
| * Fixes for XLCJack Lloyd2018-12-311-1/+1
| | | | | | | | | | | | XLC 16 changed which macros are used to identify it. Older versions of XLC didn't work correctly anyway (#1581 #1509 etc), so just drop support for recognizing those versions.
| * Fix generic 32-bit bswapJack Lloyd2018-12-311-2/+6
| | | | | | | | Was broken by removing inclusion of rotate header
* | Fix MSVC warningsJack Lloyd2018-12-312-2/+2
|/
* Add a fuzzer for Memory_PoolJack Lloyd2018-12-291-1/+1
| | | | | | | | | Basically, test that it works. Accepts a sequence of alloc+free operations and verify that each pointer returned does not overlap with any other outstanding allocation, that the memory returned is zeroed, and that alignment is respected. Intended for testing #1800 but no reason not to land this first.
* Improve PBKDF self-tuningJack Lloyd2018-12-294-65/+66
| | | | | | | | | Make the tune interval a build-time configurable instead of hardcoding it in each source file. Also use binary search in RFC4880_encode_count instead of linear search. Fix a bug in Timer
* Correct spellingJack Lloyd2018-12-291-0/+1
|
* Add OS::read_env_variableJack Lloyd2018-12-293-9/+22
| | | | Combines the priv check and the getenv call on one.