aboutsummaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* Add an optimization suggested by Yves Jerschow to combine the fourlloyd2008-09-171-4/+4
| | | | | | | | Blowfish Sboxes into one 1024 word array and index into them at offsets. On my x86-64 machine there is no real difference between the two, but on register constrained processor like x86 it may make a large difference, since the x86 has a much easier time indexing off a single address held in a register rather than 4 distinct ones.
* Add a patch sent by Tim Burris <[email protected]> adding private operator= lloyd2008-09-173-1/+28
| | | | | | | | | | | | declarations to class declarations that do not support copying (for instance because of const members). Apparently at /W4 Visual C++ warns unless this is the case, and it seems reasonably good practice to disable copying on most of these objects anyway due to pointer and reference aliasing. Instead of adding an operator= to User_Interface, I made the member preset_passphrase non-const. This seemed like a cleaner solution to me. (It may also be the cleaner solution in the pubkey code)
* Change the constructor for LubyRackoff. Previously it took a string,lloyd2008-09-151-2/+3
| | | | | | | | | | | | | | | | | however now instead it takes a HashFunction pointer, which it deletes in its destructor. Why the change? For one, lookup.h, while seemingly a bunch of standalone functions, actually calls into a large mass of global state (in short, it is icky). I have a plan in mind for removing much of this while still providing a high level interface (actually hopefully better than now), here is just the start. Now, calling clone() on a LubyRackoff object will now return a new object with a clone() of the HashFunction. Previously we called get_hash on the name, which goes through the whole global lookup bit. This is also good since if you construct one with (say) an OpenSSL provided hash, clones of it will now also use that implementation.
* Remove the cache for BigInt::sig_words. I'm baffled how it is it workslloyd2008-09-151-67/+24
| | | | | | | on x86, x86-64, and m68k and not other platforms. Something about the memory model I'm hitting? Valgrind shows nothing. Rather than struggle with it further, for minimal gain, I'm reverting. If someone ever does figure it out, this will be easy to reapply.
* Update BigInt::grow_reg and grow_to to be non-constlloyd2008-09-151-2/+2
|
* Make MemoryRegion members non-mutable, change const declslloyd2008-09-151-8/+8
|
* Slight cleanup in loop iterationlloyd2008-09-151-2/+2
|
* Pass a pointer to a HashFunction to the MGF1 constructor, and have thatlloyd2008-09-141-3/+9
| | | | pointer used over and over again in MGF1::mask.
* The Memory_Exhaustion exception was only thrown from mem_pool.cpp, solloyd2008-09-141-9/+0
| | | | | move in there. Make it a subclass of std::bad_alloc instead of Botan::Exception (this may prove to be a design mistake).
* Add 16x16->32 word Comba multiply and squarelloyd2008-09-091-0/+3
|
* Add implementation of Salsa20 stream cipherlloyd2008-09-091-0/+39
|
* Remove bigint_mul_add_words. It was only used now in two callers,lloyd2008-09-071-2/+7
| | | | | | | bigint_simple_mul and bigint_simple_sqr. Examining these functions made it clear inlining would be beneficial, so these two functions have been moved from an anonymous namespace into mp_mulop.cpp (to allow assembly versions).
* Inline BigInt::Rep::operator[], BigInt::sig_words, and BigInt::Rep::sig_wordslloyd2008-09-071-14/+46
|
* Inline BigInt::operator[]lloyd2008-09-071-2/+2
|
* Typo fixlloyd2008-09-071-1/+1
|
* Inline BigInt::is_zerolloyd2008-09-071-2/+8
|
* Use a nibble-wide lookup table to reduce loop iterationslloyd2008-09-051-3/+5
|
* There is no real reason BigInt::grow_to needs to be private (and onelloyd2008-09-051-2/+1
| | | | | can easily perform the operation manually using get_reg), and InSiTo wants to access it, so go ahead and make it public.
* Change return type of ctz from int to u32bitlloyd2008-09-051-1/+1
|
* Replace __builtin_ctzl with a new ctz function in bit_ops.hlloyd2008-09-051-1/+12
|
* Wrap the BigInt register in a small class that caches the significantlloyd2008-09-051-6/+36
| | | | | words. BigInt::sig_words() was showing up very hot on valgrind runs, this seems to reduce the usage substantially.
* Add new aliases to the DL_Group::Format enum. The previous values werelloyd2008-09-051-3/+13
| | | | | pretty opaque; now use the easier to remember DL_Group::DSA_PARAMETERS and DL_Group::DH_PARAMETERS
* Define the functions from bit_ops.h as inline template functions, insteadlloyd2008-09-051-6/+58
| | | | of always converting to u64bit and passing to a non-inlined function.
* Remove code moved to bswap.h and rotate.h, also split xor_buf intolloyd2008-09-022-71/+65
| | | | | | xor_buf.h. The optimization using reinterpret_cast previously used in the amd64 module is now used directly in the stock header, as long as BOTAN_TARGET_UNALIGNED_LOADSTOR_OK is set.
* Split byte swap code and word rotation code off into bswap.h and rotate.hlloyd2008-09-023-2/+69
|
* Make the declaration of clear() in base classes pure virtual. So if anlloyd2008-07-182-5/+7
| | | | | | | implementation wishes to make this operation a no-op it has to explicitly declare it as such, rather than just letting the no-op default in from the base class. (Falko Strenzke was the one who pointed out this was potentially problematic.)
* And then add an empty constructor to allow things to contine to compile.lloyd2008-07-131-0/+1
| | | | Did I mention I hate C++ sometimes?
* Disable synthesized copy constructor and assignment operator forlloyd2008-07-131-0/+4
| | | | RandomNumberGenerator (really hate C++ sometimes...)
* Add the block cipher Noekeon (http://gro.noekeon.org/). Only "indirect mode"lloyd2008-07-111-0/+35
| | | | keying is supported (see section 2.3 of the specification for details)
* Add an implementation of the Shanks-Tonelli algorithm, which is used tolloyd2008-07-071-2/+8
| | | | find square roots modulo a prime. Contributed by FlexSecure GmbH
* Missing BOTAN_DLL for XTEA, noted by Joel Lowlloyd2008-07-031-1/+1
|
* Remove the free-standing function deref_alias. It only served as a forwarderlloyd2008-06-301-5/+0
| | | | | | for the implementation in Library_State. Instead explicitly call deref_alias on global_state() wherever the old freestanding version was used. This serves to make (more) uses of the global state explicit rather than implicit.
* Remove unnecessary include of rng.hlloyd2008-06-301-1/+0
|
* Previously X509_Store took two configuration values from the librarylloyd2008-06-301-1/+3
| | | | | | | | | config state: how long successful validations should be cached, and the amount of slack to allow on time boundary checks. Now these are passed as arguments to the constructor, as a pair of 32-bit integers representing the number of seconds to allow as slack and the number of seconds to cache validations for. They default to the same compiled in defaults as before, 24 hours (86400 seconds) and 30 minutes (1800 seconds), respectively.
* Remove the Config class.lloyd2008-06-303-51/+14
| | | | | | | | In reality, Config was a singleton, with the only owner being the Library_State object. Theoretically one could create and use another Config instance, but in practice it was never done. Reflect the reality and inline the members and public functions of Config in Library_State, removing Config entirely.
* Remove global_config() - replace by direct calls to global_state()lloyd2008-06-302-5/+1
|
* Add interfaces for add_entropy_source and add_entropy tolloyd2008-06-282-1/+17
| | | | | | | | | | | RandomNumberGenerator, and make ANSI_X931_PRNG's implementations just forward the arguments to the underlying RNG. This allows seeding the RNG even if no entropy modules are loaded into the library. Also it allows actually adding user-specified data; to do it otherwise would require creating the RNG objects yourself and retaining a pointer to the Randpool, which is pretty bogus. Move Null_RNG to rng.h
* Change make_rng to be a static member of RandomNumberGeneratorlloyd2008-06-281-5/+2
|
* Include rng.h in botan.hlloyd2008-06-271-0/+1
|
* New structure for entropy sources + RNGs. The entropy sources are owned bylloyd2008-06-274-11/+17
| | | | | | | Randpool, it will query them as needed (or if asked to do so). New function make_rng() that creates an RNG (X9.31 backed by a Randpool) and seeds it. Remove the entropy source related code from the Modules/Builtin_Modules classes.
* Remove the global PRNG object as well as the global list of entropy sources.lloyd2008-06-272-17/+0
|
* Remove PRNG_Unseeded throw() specifies from the RNG randomize() functions.lloyd2008-06-272-2/+2
| | | | | | They were probably not a good idea. If nothing else, these functions might throw bad_alloc, and possibly other errors. Something broad like std::exception might be applicable, but that seems pointlessly broad.
* OctetString now requires a RandomNumberGenerator& to create a randomlloyd2008-06-271-1/+1
| | | | key or IV; it does not reference the global RNG.
* Reorganize the EMSA classes, and remove the last references to prng_referencelloyd2008-06-272-2/+12
| | | | in the library ccode.
* Remove load checking, as it requires an RNG (at least at the moment).lloyd2008-06-2710-19/+25
| | | | | | | | | Probably some variation of it will be added back in later, at least to do basic checks like that primes are really odd (and we can do basic primality checks, etc, even with an RNG). Alternative: call check_key() manually on public keys you load with an RNG object.
* Split IF_Core constructor into two, one for public keys and one for private.lloyd2008-06-271-2/+5
| | | | Public version doesn't need an RNG argument.
* Remove SHA1PRNG for the moment, untillloyd2008-06-231-41/+0
| | | | | | | | | a) I am sure we really want to include this (proprietary, unanalyzed?) PRNG in Botan b) I have a chance to add test cases and clean up the code. Also note a few more changes in the changelog, and set a provisial release date for sometime in July.
* Similiar combining transform for the ElGamal, DSA, and NR private keylloyd2008-06-203-6/+7
| | | | constructors.
* Consolidate the two DH_PrivateKey constructors into a single one takinglloyd2008-06-201-2/+2
| | | | | a RNG reference, a group, and an (optional) private key. The public key is now always rederived from the private.
* Use RNG& argument for PKCS8::encrypt_key and PKCS8::PEM_encodelloyd2008-06-201-5/+12
|