aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/base/algo_registry.h
Commit message (Collapse)AuthorAgeFilesLines
* Abstract out mutex type. Make threads optional.Jack Lloyd2016-10-121-8/+8
|
* Remove Transform base classJack Lloyd2016-04-211-4/+0
| | | | | | | | | | | | | | | | | | | | | | With sufficient squinting, Transform provided an abstract base interface that covered both cipher modes and compression algorithms. However it mapped on neither of them particularly well. In addition this API had the same problem that has made me dislike the Pipe/Filter API: given a Transform&, what does it do when you put bits in? Maybe it encrypts. Maybe it compresses. It's a floor wax and a dessert topping! Currently the Cipher_Mode interface is left mostly unchanged, with the APIs previously on Transform just moved down the type hierarchy. I think there are some definite improvements possible here, wrt handling of in-place encryption, but left for a later commit. The compression API is split into two types, Compression_Algorithm and Decompression_Algorithm. Compression_Algorithm's start() call takes the compression level, allowing varying compressions with a single object. And flushing the compression state is moved to a bool param on `Compression_Algorithm::update`. All the nonsense WRT compression algorithms having zero length nonces, input granularity rules, etc as a result of using the Transform interface goes away.
* Remaining cppcheck fixes that are not covered by GH #444Daniel Neus2016-03-051-1/+1
|
* cppcheck fixes: Class 'X' has a constructor with 1 argument that is not ↵Daniel Neus2016-03-051-1/+2
| | | | explicit.
* Get rid of "extra ';'" warnings and force semicolon after macrosSimon Warta2016-01-111-4/+1
|
* String comparision fixesDaniel Neus2016-01-041-1/+1
| | | | fix PVS-Studio perfomance warnings
* Throw Lookup_Error instead of bare Exception when creating an obj failsJack Lloyd2015-12-201-24/+24
| | | | | | | in the algo factory. Fixes remaining issues of GH #369 - test_pubkey.cpp was expecting Lookup_Error when something isn't found.
* Missing addsJack Lloyd2015-12-111-1/+1
|
* Reroot the exception hierarchy into a toplevel Exception classJack Lloyd2015-12-111-3/+3
| | | | | | | | As the alternatives are unfortunate for applications trying to catch all library errors, and it seems deriving from std::runtime_error causes problems with MSVC DLLs (GH #340) Effectively reverts 2837e915d82e43
* Added myself to credits/copyright.Matej Kenda2015-11-201-0/+1
|
* Merged two sections of Botan namespace as suggested by randombit. ↵Matej Kenda2015-11-191-5/+4
| | | | Preprocessing sections are now split in two.
* Fixed default ctor for WinCS_MutexMatej Kenda2015-11-041-1/+1
|
* #321: changed implementation of CriticalSection locking in algo registry.Matej Kenda2015-11-041-34/+38
|
* Algo_Registry: Use CRITICAL_SECTION instead of std::mutex to prevent hang in ↵Matej Kenda2015-11-031-5/+49
| | | | DllMain when initialising global constants.
* Handle dependencies re static linking. GH #279Jack Lloyd2015-09-171-1/+1
| | | | | | | | | | | | | | Previously we were hanging on the type destructors to pull in the relevant objects. However that fails in many simple cases where the object is never deleted. For every type involved in the algo registry add static create and providers functions to access the algo registry. Modify lookup.h to be inline and call those functions, and move a few to sub-headers (eg, get_pbkdf going to pbkdf.h). So accessing the registry involves going through the same file that handles the initialization, so there is no way to end up with missing objs.
* Fix static lib registration for block, hash, mac, stream, kdfJack Lloyd2015-09-101-3/+5
| | | | | | | | | | | The support problems from having static libraries not work in the obvious way will be endless trouble. Instead have each set of registrations tag along in a source file for the basic type, at the cost of some extra ifdefs. On shared libs this is harmless - everything is going into the shared object anyway. With static libs, this means pulling in a single block cipher pulls in the text of all the them. But that's still strictly better than the amalgamation (which is really pulling in everything), and it works (unlike status quo).
* Reverse the algorithm priority orderingJack Lloyd2015-08-291-7/+10
| | | | | | Previously 0 was the highest priority and 255 was the lowest. But this is really quite confusing, instead treat 0 as lowest and 255 as highest so normal integer intuitions apply.
* Force semicolons at the end of BOTAN_REGISTER_* macro invocationsDaniel Seither2015-07-151-2/+8
| | | | | | | | | | | | | | All BOTAN_REGISTER_* macros are defined as namespace { some_command(); } So, if such a macro is used with a semicolon at the end, we have `namespace { ... };` which is unnecessary and makes gcc complain when run with with -Wpedantic. However, for consistency, it is great to end those macro invocations with a semicolon. This commit forces semicolons by appending a dummy definition with the necessary semicolon missing.
* In Algo_Registry if a maker func fails, try the next most preferred onelloyd2015-03-051-31/+52
| | | | | | | | instead of bailing out immediately. Rename the 'builtin' provider to 'base' since really they are all built in. Fix MARK-4 when OpenSSL was enabled - it did not respect the skip param.
* Hide Algorithm_Factory and use the functions in lookup.h internally.lloyd2015-03-041-1/+1
| | | | | | Fix two memory leaks (in TLS and modes) caused by calling get_foo and then cloning the result before saving it (leaking the original object), a holdover from the conversion between construction techniques in 1.11.14
* Add missing includelloyd2015-03-021-0/+1
|
* Enable OpenSSL for providing ciphers and hashes again.lloyd2015-02-051-13/+22
|
* Remove algo factory, engines, global RNG, global state, etc.lloyd2015-02-041-0/+215
Convert all uses of Algorithm_Factory and the engines to using Algo_Registry The shared pool of entropy sources remains but is moved to EntropySource. With that and few remaining initializations (default OIDs and aliases) moved elsewhere, the global state is empty and init and shutdown are no-ops. Remove almost all of the headers and code for handling the global state, except LibraryInitializer which remains as a compatability stub. Update seeding for blinding so only one hacky almost-global RNG instance needs to be setup instead of across all pubkey uses (it uses either the system RNG or an AutoSeeded_RNG if the system RNG is not available).