aboutsummaryrefslogtreecommitdiffstats
path: root/src/stream
Commit message (Collapse)AuthorAgeFilesLines
* Add deleted copy constructors/assignment operators where appropriate.lloyd2012-07-101-0/+4
| | | | | Replace C++98 style private copy constructors/assignment ops with ones annotated with delete.
* Some post merge fixups.lloyd2012-05-252-3/+5
| | | | | Fix some bugs that triggered if DEFAULT_BUFFERSIZE was either too small or an odd size.
* Resize key arrays in HMAC and SSL3_MAC when the key is set.lloyd2012-05-252-3/+2
| | | | Plus a few minor cleanups.
* For block and stream ciphers, don't set the size of the key vectorslloyd2012-05-257-31/+36
| | | | | | | | | | | until we are actually setting a key. This avoids the problem of prototype objects consuming not just memory but the precious few bytes of mlock'able memory that we're given by Linux. Use clear_mem instead of a loop in BigInt::mask_bits If OS2ECP encounters an invalid format type, include what type it was in the exception message.
* Replace 0 and NULL pointer constants with nullptr. Also fix an oldlloyd2012-05-183-3/+3
| | | | style cast in secmem.h
* Fairly huge update that replaces the old secmem types with std::vectorlloyd2012-05-188-17/+17
| | | | | | using a custom allocator. Currently our allocator just does new/delete with a memset before deletion, and the mmap and mlock allocators have been removed.
* First step towards replacing the existing containers with std::vectorlloyd2012-05-182-3/+3
| | | | | | with a custom allocator; remove the 3 argument version of MemoryRegion::copy, replacing with freestanding buffer_insert function.
* propagate from branch 'net.randombit.botan' (head ↵lloyd2011-06-131-1/+1
|\ | | | | | | | | | | 150bd11dd8090559ee1e83394b8283bf93a018de) to branch 'net.randombit.botan.c++0x' (head 7480693bb3f1e8a4e039a3e7ba3d9a7007f9730e)
| * propagate from branch 'net.randombit.botan' (head ↵lloyd2011-03-081-2/+2
| |\ | | | | | | | | | | | | | | | dd068808e5bf87c982765a8bcc314996053a5bdd) to branch 'net.randombit.botan.c++0x' (head 34696d52a8148d64f7021b3e193fc56f051b9dd2)
| * \ propagate from branch 'net.randombit.botan' (head ↵lloyd2011-02-111-1/+1
| |\ \ | | | | | | | | | | | | | | | | | | | | 13a0d36dac3709f3cb88e830ed7f8cab9e7433ab) to branch 'net.randombit.botan.c++0x' (head 2221ad8796466e7e096645de77ba856a9c902d14)
| | * \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-11-041-1/+1
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | 303b2518a80553214b1e5ab4d9b96ef54629cbc7) to branch 'net.randombit.botan.c++0x' (head d734eefabe4816be4dd3e3e6e7bb13b7ab5be148)
| | | * \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-10-281-3/+3
| | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2841fb518e20d2fe0a374e4f6b08bdbb14d5d158) to branch 'net.randombit.botan.c++0x' (head 0b9275139d6346bd3aa28d63bf8b8a03851d853d)
| | | * \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-10-131-1/+1
| | | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2898d79f992f27a328a3e41d34b46eb1052da0de) to branch 'net.randombit.botan.c++0x' (head 6cba76268fd69a73195760c021b7f881b8a6552c)
| | | | * \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-06-179-26/+60
| | | | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 294e2082ce9231d6165276e2f2a4153a0116aca3) to branch 'net.randombit.botan.c++0x' (head 0b695fad10f924601e07b009fcd781191fafcb28)
| | | | * \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-04-094-11/+11
| | | | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 75d272c759511a9a99a371ddc74bd17b2c1453b6) to branch 'net.randombit.botan.c++0x' (head 2ce9ba37cb9287a3d875921240d6682100625b9f)
| | | | * \ \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-03-091-1/+1
| | | | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9932d4d63417f7fcc199ada244cbaa6c1c32d9c1) to branch 'net.randombit.botan.c++0x' (head f4a385a376311edc62ef506c72cc56f69e6efd5a)
| | | | | * \ \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-02-251-1/+1
| | | | | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | c1db52e38b60afbc6549af5222d6e10b1b9730dd) to branch 'net.randombit.botan.c++0x' (head e56dfbfe6bffbd5b4e52b115549d885c5fd04586)
| | | | | | * \ \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-01-211-1/+1
| | | | | | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 12382647ef0a28fcb11c824c77b670cc88a4f721) to branch 'net.randombit.botan.c++0x' (head b586a3286d2c4d547ad3add5af9df1455bf4b87b)
| | | | | | | * \ \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2009-12-211-1/+1
| | | | | | | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 14c1d4dc8696d2705a70ec3d2403e01d2ca95265) to branch 'net.randombit.botan.c++0x' (head c567fa7310ba082a837562092728c4b4b882bf82)
| | | | | | | | * \ \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2009-12-1613-74/+9
| | | | | | | | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 744dccf92270cf16b80b50ee2759424c9866b256) to branch 'net.randombit.botan.c++0x' (head 2aa1acac1d05e8ea9991fe39015b1db9abc3b24e)
| | | | | | | | * | | | | | Remove to_string, replacing with std::to_stringlloyd2009-11-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert to_u32bit to use the new C++0x library func stoul instead of hand-written code.
* | | | | | | | | | | | | | PR 145 was based around an easy misunderstanding of the CTR code.lloyd2011-04-051-10/+16
| |_|_|_|_|_|_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add some comments to help explain what is going on. Also add a test using 512 blocks; all the existing ones were shorter, so increment was not being tested at all. :(
* | | | | | | | | | | | | Use size_t rather than u32bit for loop variableslloyd2011-02-161-2/+2
|/ / / / / / / / / / / /
* | | | | | | | | | | | More VC warning fixeslloyd2011-02-091-1/+1
| | | | | | | | | | | |
* | | | | | | | | | | | More VC warning fixeslloyd2010-12-131-1/+1
|/ / / / / / / / / / /
* | | | | | | | | | | 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
| | | | | |