aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Change the benchmark code to also take a buf_size, instead of using hardcodedlloyd2010-07-302-7/+28
| | | | | | | | 16 KiB buffer. Also reorder the parameters to make somewhat more sense, with the first arguments being totally mandatory and the later ones potentially optional. Provide inlined version matching the old interface that just forwards to the new call, marking it as deprecated.
* If dynamic loading fails, include result of dlerror() in the exception msglloyd2010-07-301-1/+8
|
* Add name() function to DataSource_Stream for Filter interfacelloyd2010-07-301-0/+2
|
* Restrict dyn_load to platforms where it might theoretically work:lloyd2010-07-281-0/+9
| | | | | | | | Linux, Solaris, and the BSDs. Solaris and BSD are untested, but it seems like they should work. Using libdl on Solaris is seemingly only required in Solaris 9 and earlier, but 10 has a stub library so it should work there as well.
* Remove redundant setting for adding libdl link on Linux in dyn_engine;lloyd2010-07-281-4/+0
| | | | | it relies on dyn_load which should be the sole source for this kind of stuff, since dyn_engine itself does not touch the OS level APIs.
* Add a version info function which returns a u32bit. The currentlylloyd2010-07-281-1/+12
| | | | | expected value is 20100728 (ie, today). This will allow for checking for and/or working around changes to interfaces.
* Expose Algorithm_Factory::clear_caches which clears out all of thelloyd2010-07-272-1/+10
| | | | | caches; this might be useful for applications which are, say, particularly sensitive to memory usage.
* There was an interesting bug affecting dynamically loaded engines.lloyd2010-07-272-4/+14
| | | | | | | | | | | | | | | | | | | | | | | The library initializer runs some self tests; this brings objects for a few select types (AES, SHA-1, etc) into the caches. Later on, when we add a dynamic engine, the engines aren't requeried because the cache has hits. So, for instance an dlopen'ed engine that provided AES-128 would not actually be used unless you called on the algo factory with a provider of "blah" - even using set_preferred_provider would have no effect, because that's just a request. Add a new function to Algorithm_Cache, clear_cache, which just deletes everything that is currently loaded (this is 90% of the destructor). Then call this on each cache in Algorithm_Factory when a new Engine is loaded. In normal use, this should be very fast because on init the engines are loaded one after another so clear_cache() won't do much work at all, but it ensures that if you load an engine later on in runtime it will always be found. It does have the downside that the app will then requery each Engine for each new algo after this point, but I think typically loading a dynamic engine will happen very early on so this won't be too much of a hassle. (And even if it happens in the middle of execution, everything still works, it just means some overhead the first time you ask for algo X).
* In Algorithm_Factory, delete the Engines after deleting the cacheslloyd2010-07-271-2/+2
| | | | | | | | rather than before. Otherwise, we run into a problem with dynamically loaded engines: the engine will be deleted (and thus, the external library unloaded), before calling the destructors on any objects which may have been cached, so we jump to a now invalid address instead of the destructor code.
* Add a new utility class Dynamically_Loaded_Library which wraps aroundlloyd2010-07-277-0/+308
| | | | | | | | | | the system dynamic linker (if any). Currently it only supports dlopen, and is only enabled on Linux. It will almost certainly work on BSDs and Solaris as well, though, and should be easy to extend to support Win32-style dynamic loading. Also add a new engine, Dynamically_Loaded_Engine, which loads up a new Engine object from a shared library/DLL.
* Rename Default_Engine to Core_Engine which describes its purposeslloyd2010-07-2713-38/+36
| | | | (slightly) better.
* merge of '17389a973545d2f8e25813894cdd2da1b01aa534'lloyd2010-07-275-56/+76
|\ | | | | | | and 'ada4c9893d70affd8934ab9664e390087feab3c9'
| * Oops, bad GCC version check herelloyd2010-07-271-1/+1
| |
| * Add support in CPUID for detecting PCMULUDQ and MOVBE instructions.lloyd2010-07-272-5/+19
| | | | | | | | Rename CPUID::has_aes_intel to has_aes_ni.
| * Add support for GCC's byteswap builtins. They were added in 4.3 andlloyd2010-07-271-4/+29
| | | | | | | | | | | | work for 32 and 64 bit integers. Using these instead of inline asm may offer better scheduling on x86, and additionally offers native byteswapping on other platforms (PPC, ARM, etc).
| * Modify CPUID so all the check functions are purely inline. Add a newlloyd2010-07-263-47/+28
| | | | | | | | | | initialize() call which must be called prior to use of any other functions.
* | Add support for Camellia in OpenSSL enginelloyd2010-07-221-0/+6
| |
* | Avoid unused argument warninglloyd2010-07-221-1/+3
| |
* | Use configured compiler for Pythonlloyd2010-07-221-2/+3
|/
* Consolidate the two engines that provided assembler implementationslloyd2010-07-1311-98/+30
| | | | | | (amd64_eng and ia32_eng) into a new asm_engine. This same engine could also be used in the event that asm code for other CPUs was added later on.
* Remove unused UI param to CMS_Decoderlloyd2010-07-092-6/+3
|
* Drop support for running configure with Python 2.4. This allowslloyd2010-07-092-2/+2
| | | | | | | | | removing several workarounds for limitations in optparse in that release, and also allows using the ternary operator added in 2.5. As far as I can tell, the only still active release of any Linux/BSD distro that uses 2.4 is RHEL5. The beta of RHEL6 has 2.6, and it seems likely that RHEL6 will be out before 1.10.0.
* Delete os defaults file - only used by Perllloyd2010-07-091-19/+0
|
* Rename S2K to PBKDF, because that is by far the most common name - S2Klloyd2010-07-0916-118/+108
| | | | | | | | | | | | | really is only used by OpenPGP, and largely it was named S2K here because the OpenPGP S2K was implemented years before the ones in PKCS #5. We have a typedef of PBKDF to S2K, and an inlined get_s2k that calls get_pbkdf for source compatability. There doesn't seem to be any reason to have a forward for the renamed s2k.h header - to actually use a PBKDF, you'd have to either include lookup.h and call get_s2k / get_pbkdf, or else include an algorithm-specific header and use it directly. In either case, including s2k.h is neither necessary nor sufficient.
* Fix constructorlloyd2010-07-091-1/+1
|
* Argh: SecureVector's constructor needs to behave differentlylloyd2010-07-071-2/+14
| | | | | | | | | | | | | | depending on if INITIAL_LEN is non-zero. Normal semantics are the vector will change size based on whatever it is constructed with, but that's bad in cases like SecureVector<byte, 4> val(buffer, 3); which in the past would be a 4 valued thing with 3 elements set and one zero trailing. (This construct showed up in base64 and possibly elsewhere). If INITIAL_LEN is set, use copy instead so the length does not change. C++0x cannot come soon enough.
* These functions are internal use only, and don't need to be exported withlloyd2010-06-303-13/+15
| | | | BOTAN_DLL
* Make round_up and round_down templates instead of fixed to use u32bitslloyd2010-06-294-13/+21
|
* If the Keyed_Filter's set_iv is called (ie, in the case that the1.9.9lloyd2010-06-281-2/+3
| | | | | filter doesn't support IVs at all), throw an exception unless the IV has zero length.
* Give all Filter objects a method for querying their namelloyd2010-06-2816-5/+64
|
* Simplify feature checkslloyd2010-06-281-7/+12
|
* Typo fixlloyd2010-06-281-1/+1
|
* For the SHA-2 classes, don't use inheritence to share a handful oflloyd2010-06-284-85/+106
| | | | | things, just share the compression function via an anon namespace member, and replicate the simple stuff like copy_out.
* Add a new configure option --maintainer-mode which turns on the fulllloyd2010-06-281-2/+3
| | | | | set of warning flags. Use just plain '-Wall -W' for regular GCC so the default build is happy on arbitrarily old versions.
* If we are going to lazily initialize, just create the type and calllloyd2010-06-251-2/+4
| | | | its constructor directly, instead of going through LibraryInitializer.
* Add detection support for upcoming AVXlloyd2010-06-251-1/+8
|
* Avoid name collision in amalgamationlloyd2010-06-221-5/+10
|
* Avoid unused parameter warninglloyd2010-06-221-1/+1
|
* We can't hide the filter wrappers in an anon namespace because theylloyd2010-06-222-6/+26
| | | | are forward declared in the headers.
* Only call the scalar versions if we actually have leftover blocks tolloyd2010-06-224-8/+16
| | | | process
* Doxygenlloyd2010-06-225-14/+76
|
* Doxygenlloyd2010-06-2110-17/+55
|
* Doxygenlloyd2010-06-212-6/+229
|
* Define X509_Object::encode in terms of BER_encode and PEM_encodelloyd2010-06-211-22/+12
|
* Doxygenlloyd2010-06-213-8/+72
|
* Doxygenlloyd2010-06-214-13/+41
|
* Doxygenlloyd2010-06-219-50/+226
|
* Doxygenlloyd2010-06-218-29/+107
|
* Doxygenlloyd2010-06-211-0/+20
|
* Add a simple comment for the Botan namespace decl in types.h. Thislloyd2010-06-211-0/+3
| | | | | triggers Doxygen generating warnings for global functions declared in the namespace that aren't documented.