aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstate/libstate.h
Commit message (Collapse)AuthorAgeFilesLines
* Move the functions that directly manipulate the global state singletonlloyd2010-08-061-19/+1
| | | | | | | | | | | into global_state.{h,cpp}. Move all of the functions into a new namespace Global_State_Management, though exposing global_state() into the Botan namespace for compatability. Also add new functions global_state_exists and set_global_state_unless_set which may be helpful in certain tricky initialization scenarios (eg when an application using botan also uses a library which may or may not itself use botan).
* Replace "@return a blah" and "@return the blah" with just "@return blah"lloyd2010-06-161-4/+4
|
* More Doxygen commentslloyd2010-06-161-0/+3
|
* More Doxygen updates/fixeslloyd2010-06-151-2/+2
|
* Fix a few hundred Doxygen warningslloyd2010-06-151-2/+2
|
* There are some nasty API problems that are caused by having to pass alloyd2010-03-191-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | PRNG everywhere. The removal of the global PRNG was generated by a desire to remove the global library state entirely. However the real point of this was to remove the use of globally visible _mutable_ state; of the mutable state, the PRNG is probably the least important, and the most useful to share. And it seems unlikely that thread contention would be a major issue in the PRNG. Add back a global PRNG to Library_State. Use lazy initialization, so apps that don't ever use a PRNG don't need a seeding step. Then have AutoSeeded_RNG call that global PRNG. Offer once again RandomNumberGenerator& Library_State::global_rng(); which returns a reference to the global PRNG. This RNG object serializes access to itself with a mutex. Remove the hack known as Blinding::choose_nonce, replace with using the global PRNG to choose a blinding nonce
* Remove config options to toggle if X.509 extensions are critical orlloyd2010-03-101-15/+0
| | | | | | | | not. Instead provide via Extensions::add(). No way to modify behavior currently, it just follows the previous default police. Remove the config options from Library_State entirely. Die, mutable singletons, die.
* Remove the base/default_allocator option, instead save as a per-libstatelloyd2010-03-101-5/+18
| | | | variable directly.
* Add doxygen commentslloyd2009-12-291-12/+39
|
* The first argument of Library_State::set_option was accidentally beinglloyd2009-09-091-1/+1
| | | | | passed as a 'const std::string' instead of a const reference. Can't fix in 1.8 since it is ABI breaking.
* Thomas Moschny passed along a request from the Fedora packagers which camelloyd2009-03-301-10/+12
| | | | | | | | | | | | | | | up during the Fedora submission review, that each source file include some text about the license. One handy Perl script later and each file now has the line Distributed under the terms of the Botan license after the copyright notices. While I was in there modifying every file anyway, I also stripped out the remainder of the block comments (lots of astericks before and after the text); this is stylistic thing I picked up when I was first learning C++ but in retrospect it is not a good style as the structure makes it harder to modify comments (with the result that comments become fewer, shorter and are less likely to be updated, which are not good things).
* Remove Library_State::add_engine and Algorithm_Factory::add_engine,lloyd2008-11-121-2/+0
| | | | | | | | replacing with an updated constructor to Algorithm_Factory taking a vector of Engine*. The semantics of adding engines at runtime were not defined nor very clear, it seems best to prohibit this unless and until it is explicitly thought through (and until a need for it presents itself).
* Library_State had two functions that did the same thing,lloyd2008-11-121-2/+1
| | | | | | | | | | | | | | | algo_factory and algorithm_factory. This is confusing so for consistency/simplicity, remove algo_factory, making algorithm_factory the function to call. In 1.7.14, several functions in lookup.h, including retrieve_block_cipher, retrieve_hash, etc were changed to accept a Library_State& reference. However it turns out with the modified design I've settled upon for 1.8 that it is not necessary to change those interfaces; instead they always refer to the global_state algorithm factory which is exactly the semantics one would expect/desire 99% of the time (and is source compatible with code written for 1.6, also a plus)
* After finding myself typing global_state().algorithm_factory() insteadlloyd2008-11-111-1/+2
| | | | | of algo_factory() several times, I decided to rename the functions. algorithm_factory() just forwards to algo_factory as an inline.
* Add back Library_State::add_engine for Monotonelloyd2008-11-101-0/+2
|
* Drop all options except thread safety. Also remove InitializerOptions, etclloyd2008-11-101-2/+1
| | | | | | | | | | | | | | | and reduce all the arguments to just a bool specifying threads. selftests: off (if desired, run passes_self_test in selftest.h) fips140: Just ran the self tests, totally bogus option. use_engine: On by default (that is, if OpenSSL or asm code is compiled in, it's used by default). One can get better control over this using the provider feature of SCAN_Name (though this doesn't handle cases like nested algorithms yet). secure_memory: On by default.
* Remove Modules class from the initializer code - it just wasn't that usefullloyd2008-11-101-3/+1
| | | | as an abstraction. Check #ifdef's for engines and such directly in libstate.cpp
* Add a class Algorithm_Factory which encapsulates the Engine classes (andlloyd2008-11-101-34/+16
| | | | which will eventually encapsulate the lookup logic as well)
* Split base.h into block_cipher.h and stream_cipher.hlloyd2008-11-081-1/+3
| | | | | | It turned out many files were including base.h merely to get other includes (like types.h, secmem.h, and exceptn.h). Those have been changed to directly include the files containing the declarations that code needs.
* Move libstate and selftest out of core/ dir to toplevellloyd2008-10-261-0/+142