aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
Commit message (Collapse)AuthorAgeFilesLines
* Prefer GCC builtin except on ARM, add comment as to whylloyd2011-03-141-6/+11
|
* Assume ARMs are little-endian by default; big-endian ARM seems to be a rarity.lloyd2011-03-141-20/+32
| | | | | | GCC 4.3 on ARM converts __builtin_bswap32 into a jump into libgcc rather than 4 simple instructions, so write it out using inline asm instead.
* Remove inclusions of unused headers.lloyd2011-02-101-1/+0
| | | | Avoid using auto_ptr in the CVC headers.
* Another castlloyd2011-02-091-1/+1
|
* Some casts to avoid VC warningslloyd2011-02-091-3/+3
|
* Add a new configure.py option --distribution-info which sets a macrolloyd2011-02-072-10/+25
| | | | | | | | | | | | | | | | | | | | | | | in build.h named BOTAN_DISTRIBUTION_INFO. The default value is 'unspecified'. People packaging botan could set this to another value, for instance 'Gentoo 1.9.13-r3' or 'Debian 1.9.13-1', or 'pristine' to indicate a completely unmodified/stock version. This was suggested by Zooko for Crypto++ in http://sourceforge.net/apps/trac/cryptopp/ticket/11 and seemed like an idea worth stealing. Don't default the version datestmap to the current day if unset, instead set to zero. This allows applications to detect unreleased versions. Document that version_datestamp will return zero for unreleased versions. Change the version_string function to return more information about the current version, including the release date and distribution information. It will now return strings like: Botan 1.9.13 (released 20110207, distribution Gentoo 1.9.13-r3) or for an unreleased version: Botan 1.9.13 (unreleased version, distribution unspecified)
* According to PR 137, cpuid.h doesn't exist with Clang on OS X orlloyd2011-01-211-1/+1
| | | | | | | | FreeBSD. It is not being installed by Clang, so it appears on my machine Clang is actually pulling the header in from GCC's private include directory. Closes PR 137
* Use size_t for shift and rotate values. Also define rotate_left andlloyd2010-12-284-18/+21
| | | | | rotate_right for SIMD types as a template specialization to avoid problems in the amalgamation.
* If the user defines BOTAN_NO_SSE_INTRINSICS, avoid includinglloyd2010-12-222-3/+3
| | | | | | intrinsics headers in header files. This is particularly useful for allowing code that will be compiled by nvcc to include loadstor.h, but might be useful in other situations as well.
* Clang 2.8 also has cpuid.hlloyd2010-11-291-1/+1
|
* Add assert equallloyd2010-11-291-8/+18
|
* Doxygen updates.lloyd2010-11-021-12/+10
| | | | | Remove version of search_map that returns two distinguishing results; only used in one place, and that can be replaced by a call to count()
* Doxygenlloyd2010-11-022-3/+15
|
* Add new top-level algorithm which provides basic functionality: namelloyd2010-11-012-154/+0
| | | | | | | | 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.
* Remove BufferedComputation::OUTPUT_LENGTHlloyd2010-10-291-13/+2
|
* Prefix vs postfixlloyd2010-10-152-4/+4
|
* More size_tlloyd2010-10-151-24/+24
|
* More size_tlloyd2010-10-132-7/+7
|
* Remove the upto argument to update_belloyd2010-10-131-5/+8
|
* Use output_length() instead of OUTPUT_LENGTH pseudo-propertylloyd2010-10-131-4/+4
|
* Add accessors for block size and output lengthlloyd2010-10-131-0/+5
|
* s/u32bit/size_t/ in utilslloyd2010-10-1311-55/+55
|
* Use size_t for BufferedComputation::add_datalloyd2010-10-122-11/+12
|
* Use size_t in filterslloyd2010-10-121-1/+1
| | | | | This breaks API for anyone creating their own Filter types, but it had to happen eventually.
* Add a simple update_be to BufferedComputation that takes an integerlloyd2010-10-121-0/+10
| | | | | and writes the bytes to the stream in big-endian order. Use it in KDF2, MGF1, and FPE.
* Use size_t in all of math, remove to_u32bitlloyd2010-10-121-0/+1
|
* Drop debug.h, it didn't turn out to be that useful for most things,lloyd2010-10-072-38/+0
| | | | especially now that the standalone hex encoder is around
* Doxygenlloyd2010-10-011-14/+61
|
* There is a pretty common pattern in the code for testing for internallloyd2010-09-263-0/+86
| | | | | | | | | | errors of the form if(some_expr_indicating_failure) throw Internal_Error("Some mildly informative message"); Make this simpiler with the addition of a BOTAN_ASSERT macro which will throw an exception upon failure.
* First set of changes for avoiding use implicit vector->pointer conversionslloyd2010-09-131-3/+6
|
* Dynamic loading confirmed to work on Windows (tested Windows 7 x64)lloyd2010-09-081-0/+1
|
* Under certain compilation modules, HMODULE isn't a void* but rather alloyd2010-09-081-2/+2
| | | | | | pointer to a nonce struct; presumably for slightly better typechecking. In case we're compiling under such a mode, case the first argument to FreeLibrary and GetProcAddress to a HMODULE.
* Cast the first argument to msync, munmap, mlock, and munlock to char*lloyd2010-09-071-2/+2
| | | | | to fix compilation on Solaris. Everybody else, including POSIX.1, uses void* here, but as usual Solaris likes to be special.
* Work around Sun Studio multimap insert buglloyd2010-09-031-0/+5
|
* Uglify Data_Store::search_with a little to go through multimap_insertlloyd2010-09-031-1/+7
| | | | to avoid a Sun Studio bug.
* Remove filter/pipe dependency herelloyd2010-09-032-14/+6
|
* Add support for Windows-style dynamic loading with LoadLibrary. Notlloyd2010-08-252-8/+31
| | | | yet tested.
* Workaround problem with GCC 3 - it doesn't like you casting pointerslloyd2010-08-101-0/+4
| | | | | | to pointers-to-functions (which, admittedly, is undefined in ISO C++, but doing this is required to use dlopen). Using the dumb hammer of a C-style cast works, though.
* Also allow clang with 32-bit assembly code, everything seems to worklloyd2010-08-082-0/+19
| | | | fine with latest SVN.
* Clang understands at least some GCC inline asm syntax as well as whatlloyd2010-08-081-0/+1
| | | | an .S file is, so allow it for x86-64. Tested/works with Clang SVN.
* If we can't access cpuid, but we know that we are compiling forlloyd2010-08-081-0/+9
| | | | | | x86-64, then enable SSE2 anyway because we know any x86-64 processor does have SSE2, and the OS has to support it because it's part of the standard ABIs.
* If dynamic loading fails, include result of dlerror() in the exception msglloyd2010-07-301-1/+8
|
* 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.
* Add a new utility class Dynamically_Loaded_Library which wraps aroundlloyd2010-07-273-0/+122
| | | | | | | | | | 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.
* Oops, bad GCC version check herelloyd2010-07-271-1/+1
|
* Add support in CPUID for detecting PCMULUDQ and MOVBE instructions.lloyd2010-07-271-4/+18
| | | | 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-262-47/+25
| | | | | initialize() call which must be called prior to use of any other functions.
* Consolidate the two engines that provided assembler implementationslloyd2010-07-132-2/+2
| | | | | | (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.
* Make round_up and round_down templates instead of fixed to use u32bitslloyd2010-06-291-6/+14
|