aboutsummaryrefslogtreecommitdiffstats
path: root/src/hash/skein/skein_512.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fairly huge update that replaces the old secmem types with std::vectorlloyd2012-05-181-6/+6
| | | | | | 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.
* Remove all uses of MemoryRegion::copy outside of internal uses inlloyd2012-05-181-1/+1
| | | | secmem.h. Mostly replaced by assign or copy_mem.
* First step towards replacing the existing containers with std::vectorlloyd2012-05-181-2/+2
| | | | | | with a custom allocator; remove the 3 argument version of MemoryRegion::copy, replacing with freestanding buffer_insert function.
* Post merge fixlloyd2011-07-121-1/+2
|
* propagate from branch 'net.randombit.botan' (head ↵lloyd2011-07-121-1/+1
|\ | | | | | | | | | | 23a326fa36a31dd39347a8864e1f5740669a905e) to branch 'net.randombit.botan.cxx11' (head 9d3ac8dd45f7673c85dca41968e7750acc90bdff)
| * 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 ↵lloyd2010-11-041-1/+1
| | |\ | | | | | | | | | | | | | | | | | | | | 303b2518a80553214b1e5ab4d9b96ef54629cbc7) to branch 'net.randombit.botan.c++0x' (head d734eefabe4816be4dd3e3e6e7bb13b7ab5be148)
| | | * propagate from branch 'net.randombit.botan' (head ↵lloyd2010-10-131-4/+4
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | cba32f885eb7889a9711cbee120df42839deb9d0) to branch 'net.randombit.botan.c++0x' (head 7cb9cdfda0f3dedab24f1d3bc7e7ea9b22164234)
| | | * \ 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-171-1/+1
| | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 294e2082ce9231d6165276e2f2a4153a0116aca3) to branch 'net.randombit.botan.c++0x' (head 0b695fad10f924601e07b009fcd781191fafcb28)
| | | | * \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-04-091-1/+1
| | | | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 75d272c759511a9a99a371ddc74bd17b2c1453b6) to branch 'net.randombit.botan.c++0x' (head 2ce9ba37cb9287a3d875921240d6682100625b9f)
| | | | * \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2009-12-241-2/+2
| | | | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 367d157c1221a162f5b4098492944a509ef6d019) to branch 'net.randombit.botan.c++0x' (head 1b9e8c4e92663f30b7d57b0fd8f57eb13cfce155)
| | | | * \ \ \ \ 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-161-1/+1
| | | | | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | | | | | The Algorithm_Factory has this logic on looking for an object:lloyd2011-07-051-0/+2
|/ / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Check the cache; if found, return value - Populate cache, if the value is already there, delete the old object and save the new one. - Recheck the cache value Raja <[email protected]> pointed out on the list that this could race if multiple threads called a lookup function in close succession while the cache was cold. All of them would fail the lookup, then each of them would add it, but the values returned would be deleted by other threads. Instead, declare that first write wins. Then, the cache stays consistent even if there is a race, the only issue is an extra search and delete. Modify GOST and Skein, as their name() function did not roundtrip properly which caused failures otherwise.
* / / / / / / / / / Maintainer mode warning cleanups, mostly for C style casts which Illoyd2011-04-181-4/+8
|/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | added to the flags here.
* | | | | | | | | Update Skein-512 for the new 1.3 specification, just changes the keylloyd2010-11-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | schedule constant to prevent rotational attacks.
* | | | | | | | | Remove BufferedComputation::OUTPUT_LENGTHlloyd2010-10-291-1/+0
| |_|_|_|_|_|_|/ |/| | | | | | |
* | | | | | | | More size_t. Document changeslloyd2010-10-131-4/+4
|/ / / / / / /
* | | | | | | Remove HashFunction::HASH_BLOCK_SIZE entirelylloyd2010-10-131-1/+1
| | | | | | |
* | | | | | | Use size_t for BufferedComputation::add_datalloyd2010-10-121-10/+10
| | | | | | |
* | | | | | | Completely remove the second parameter to SecureVector which specifieslloyd2010-09-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-131-4/+9
| | | | | | |
* | | | | | | Anywhere where we use MemoryRegion::begin to get access to the raw pointerlloyd2010-09-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-071-3/+3
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | 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.
* | | | | Remove SecureBuffer, which is the fixed-size variant of SecureVector.lloyd2010-03-231-1/+1
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Use a u32bit for the length argument to ubi_512. That value cannot possiblylloyd2009-12-231-2/+2
|/ / / | | | | | | | | | | | | | | | be larger than 4294967232 because you can give at most 2^32-1 bytes of data at a time to Skein_512::add_data, and Skein always needs to buffer at least one byte.
* | / Un-internal loadstor.h (and its header deps, rotate.h andlloyd2009-12-211-1/+2
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | 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-161-1/+1
|/ | | | | | | | | | | | | 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.
* Add a new looping load_be / load_le for loading large arrays at once, andlloyd2009-10-291-2/+2
| | | | | | | | change some of the hash functions to use it as low hanging fruit. Probably could use further optimization (just unrolls x4 currently), but merely having it as syntax is good as it allows optimizing many functions at once (eg using SSE2 to do 4-way byteswaps).
* Remove all exception specifications. The way these are designed in C++ islloyd2009-10-221-1/+1
| | | | | | 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.
* Change Skein-512 to match the tweaked 1.2 specification. Round constantslloyd2009-09-151-8/+8
| | | | in the Threefish cipher have changed to increase diffusion.
* Avoid a crash in Skein_512::add_data if it is called with a zero-lengthlloyd2009-07-141-0/+3
| | | | input vector.
* Mark Skein_512 with the BOTAN_DLL macrolloyd2009-06-061-0/+6
| | | | | | | | | | | | | | Add a comment that the limitation of the personalization string being a maximum of 64 characters is due to the implementation and not the specification (but it makes it easy to implement, and in this particular case 64 characters is probably fine). Add some tests for the personalization option, generated by the Skein reference implementation. Disable stripping whitespace in checks/misc.cpp:strip - it strips the personalization tag, which breaks the test, and isn't needed otherwise because the test files are well-formed.
* Small cleanups in the Skein-512 source, and add support for thelloyd2009-06-031-66/+61
| | | | personalization option.
* Add an implementation of Skein-512lloyd2009-06-021-0/+258