aboutsummaryrefslogtreecommitdiffstats
path: root/src/stream
Commit message (Collapse)AuthorAgeFilesLines
* Unroll the loop in fixedS to deal with Clanglloyd2010-11-031-7/+20
|
* Remove needless destructorslloyd2010-11-031-2/+0
|
* Add new top-level algorithm which provides basic functionality: namelloyd2010-11-011-1/+1
| | | | | | | | query, clearing, and cloning. Applies to ciphers, hashes, MACs, and PBKDFs. May extend to KDFs later as well. A single combined hierarchy in particular will make the algo_factory much simpler.
* Unusedlloyd2010-10-291-2/+0
|
* Always do 256 blocks at a time in CTR, makes increment easierlloyd2010-10-291-23/+14
|
* Use u32bit herelloyd2010-10-291-4/+4
|
* Eliminate the constant size_t values in SymmetricAlgorithm that givelloyd2010-10-2810-39/+40
| | | | | | | | | | | | | | | | | | | the parameters of the key length. Instead define a new function which returns a simple object which contains this information. This definitely breaks backwards compatability, though only with code that directly manipulates low level objects like BlockCipher*s directly, which is probably relatively rare. Also remove some deprecated accessor functions from lookup.h. It turns out block_size_of and output_size_of are being used in the TLS code; I need to remove them from there before I can delete these entirely. Really that didn't make much sense, because they assumed all implementations of a particular algorithm will have the same specifications, which is definitely not necessarily true, especially WRT key length. It is much safer (and probably simpler) to first retrieve an instance of the actual object you are going to use and then ask it directly.
* More size_tlloyd2010-10-151-3/+3
|
* s/BLOCK_SIZE/block_size()/lloyd2010-10-134-10/+11
|
* Use size_t rather than u32bit in SymmetricAlgorithmlloyd2010-10-1312-13/+15
|
* s/u32bit/size_t/ in streamlloyd2010-10-1314-108/+118
|
* More changes to avoid vector to pointer implicit conversionslloyd2010-09-141-2/+2
|
* Completely remove the second parameter to SecureVector which specifieslloyd2010-09-145-15/+26
| | | | | | | | | | | | | | | | | | | | the initial/default length of the array, update all users to instead pass the value to the constructor. This is a old vestigal thing from a class (SecureBuffer) that used this compile-time constant in order to store the values in an array. However this was changed way back in 2002 to use the same allocator hooks as the rest of the containers, so the only advantage to using the length field was that the initial length was set and didn't have to be set in the constructor which was midly convenient. However this directly conflicts with the desire to be able to (eventually) use std::vector with a custom allocator, since of course vector doesn't support this. Fortunately almost all of the uses are in classes which have only a single constructor, so there is little to no duplication by instead initializing the size in the constructor.
* Remove more uses of vector to pointer implicit conversionslloyd2010-09-134-22/+22
|
* Anywhere where we use MemoryRegion::begin to get access to the raw pointerlloyd2010-09-134-9/+10
| | | | | representation (rather than in an interator context), instead use &buf[0], which works for both MemoryRegion and std::vector
* Big, invasive but mostly automated change, with a further attempt atlloyd2010-09-076-18/+18
| | | | | | | | | | | | | | harmonising MemoryRegion with std::vector: The MemoryRegion::clear() function would zeroise the buffer, but keep the memory allocated and the size unchanged. This is very different from STL's clear(), which is basically the equivalent to what is called destroy() in MemoryRegion. So to be able to replace MemoryRegion with a std::vector, we have to rename destroy() to clear() and we have to expose the current functionality of clear() in some other way, since vector doesn't support this operation. Do so by adding a global function named zeroise() which takes a MemoryRegion which is zeroed. Remove clear() to ensure all callers are updated.
* Yet more Doxygen commentslloyd2010-06-161-0/+3
|
* Move a couple of StreamCipher functions to a source file to avoid thelloyd2010-06-162-8/+26
| | | | Doxygen vs GCC problem.
* More Doxygen commentslloyd2010-06-163-3/+13
|
* More Doxygen updates/fixeslloyd2010-06-157-12/+15
|
* Fix a few hundred Doxygen warningslloyd2010-06-152-2/+2
|
* Use "/*" instead of "/**" in starting comments at the begining of a file.lloyd2010-06-071-1/+1
| | | | | This caused Doxygen to think this was markup meant for it, which really caused some clutter in the namespace page.
* Change BlockCipher::parallelism() to return the native parallelism oflloyd2010-05-251-1/+1
| | | | | | | | | | | | | | | | | | | | the implementation rather than the preferred one. Update all implementations. Add a new function parallel_bytes() which returns parallelism() * BLOCK_SIZE * BUILD_TIME_CONSTANT This is because i noticed all current calls of parallelism() just multiplied the result by the block size already, so this simplified that code. The build time constant is set to 4, which was the previous default return value of parallelism(). However the SIMD versions returned 2*native paralellism rather than 4*, so this increases the buffer sizes used for those algorithms. The constant multiple lives in buildh.in and build.h, and is named BOTAN_BLOCK_CIPHER_PAR_MULT.
* Remove SecureBuffer, which is the fixed-size variant of SecureVector.lloyd2010-03-234-11/+11
| | | | | | | | | | | | | | Add a second template param to SecureVector which specifies the initial length. Change all callers to be SecureVector instead of SecureBuffer. This can go away in C++0x, once compilers implement N2712 ("Non-static data member initializers"), and we can just write code as SecureVector<byte> P{18}; instead
* Minor cleanups in Salsa20 codelloyd2010-03-032-42/+9
|
* Use a macro to make Salsa20 code a bit more compactlloyd2010-03-031-66/+26
|
* Add XSalsa20lloyd2010-03-032-12/+108
|
* Instead of the mode parallelism being specified via macros, have itlloyd2010-02-251-2/+2
| | | | | | | | | depend on the particular implementation. Add a new virtual function to BlockCipher named parallelism that returns the number of blocks the cipher object could or might want to process in parallel. Currently set to 1 by default but may make sense to increase this for even scalar implementations since it seems like better caching behavior makes it a win.
* Clean up exceptions. Remove some unused ones like Config_Error. Makelloyd2010-01-051-2/+2
| | | | | | | Invalid_Argument just a typedef for std::invalid_argument. Make Botan::Exception a typedef for std::runtime_error. Make Memory_Exhaustion a public exception, and use it in other places where memory allocations can fail.
* Un-internal loadstor.h (and its header deps, rotate.h andlloyd2009-12-213-3/+5
| | | | | | | | | | | | | | bswap.h); too many external apps rely on loadstor.h existing. Define 64-bit generic bswap in terms of 32-bit bswap, since it's not much slower if 32-bit is also generic, and much faster if it's not. This may be quite helpful on 32-bit x86 in particular. Change formulation of generic 32-bit bswap. It may be faster or slower depending on the CPU, especially the latency and throuput of rotate instructions, but should be faster on an ideally superscalar processor with rotate instructions (ie, what I expect future CPUs to look more like).
* Make many more headers internal-only.lloyd2009-12-166-9/+9
| | | | | | | | | | | | | Fixes for the amalgamation generator for internal headers. Remove BOTAN_DLL exporting macros from all internal-only headers; the classes/functions there don't need to be exported, and avoiding the PIC/GOT indirection can be a big win. Add missing BOTAN_DLLs where necessary, mostly gfpmath and cvc For GCC, use -fvisibility=hidden and set BOTAN_DLL to the visibility __attribute__ to export those classes/functions.
* Full working amalgamation build, plus internal-only headers concept.lloyd2009-12-167-65/+0
|
* Small cleanups in the Turing codelloyd2009-11-171-18/+20
|
* Rename/remove some secmem member variables for better matching with STLlloyd2009-11-173-4/+4
| | | | | | | | containers (specifically vector). Rename is_empty to empty Remove has_items Rename create to resize
* Remove the 'realname' attribute on all modules and cc/cpu/os info files.lloyd2009-10-297-15/+0
| | | | | Pretty much useless and unused, except for listing the module names in build.h and the short versions totally suffice for that.
* Remove all exception specifications. The way these are designed in C++ islloyd2009-10-2213-13/+13
| | | | | | just too fragile and not that useful. Something like Java's checked exceptions might be nice, but simply killing the process entirely if an unexpected exception is thrown is not exactly useful for something trying to be robust.
* Similiar treatment for OFB which is also just a plain stream cipherlloyd2009-10-144-0/+161
|
* Convert CTR_BE from a Filter to a StreamCipher. Must wrap in a ↵lloyd2009-10-143-0/+205
| | | | | | StreamCipher_Filter to pass it directly to a Pipe now.
* Cleanups/random changes in the stream cipher code:lloyd2009-10-1410-92/+64
| | | | | | | | | | | | | Remove encrypt, decrypt - replace by cipher() and cipher1() Remove seek() - not well supported/tested, I want to redo with a new interface once CTR and OFB modes become stream ciphers. Rename resync to set_iv() Remove StreamCipher::IV_LENGTH and add StreamCipher::valid_iv_length() to allow multiple IV lengths (as for instance Turing allows, as would Salsa20 if XSalsa20 were supported).
* Remove unneeded headerslloyd2009-09-211-2/+0
|
* Combine the 4 sbox calculations in the key schedule so that all four arelloyd2009-08-312-25/+25
| | | | | computed in parallel. Not a huge win but slightly faster (which affects things like Lion when using Turing), most likely due to more available ILP
* Add a script that reads the output of print_deps.py and rewriteslloyd2009-07-151-5/+4
| | | | | | the info.txt files with the right module dependencies. Apply it across the codebase.
* Add dependencies for stream ciphers on streamlloyd2009-07-023-0/+12
|
* Thomas Moschny passed along a request from the Fedora packagers which camelloyd2009-03-3011-135/+157
| | | | | | | | | | | | | | | 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 redundent includeslloyd2008-11-091-2/+0
|
* Rename SymmetricAlgorithm::key to key_schedule to avoid many namelloyd2008-11-098-8/+8
| | | | conflicts/collisions
* Split the last parts of the 'core' modulelloyd2008-11-081-0/+15
| | | | Add some missing info.txts
* Split ciphers into block and stream ciphers. Move base class headerslloyd2008-11-0815-0/+1174