aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
Commit message (Collapse)AuthorAgeFilesLines
* Fix POWER6 AltiVec detectionlloyd2009-12-301-0/+1
|
* Oops, it's TARGET_CPU_IS_XXX_FAMILY, not TARGET_IS_XXX_FAMILY.lloyd2009-12-302-5/+5
| | | | Also, fix AltiVec detection on Linux and NetBSD for most G4s.
* Clean up AltiVec detection code. Add (untested) support for OS X AltiVeclloyd2009-12-301-53/+74
| | | | detection.
* Use IS_XXX_FAMILY macros where usefullloyd2009-12-301-2/+1
|
* Mark read/write prefetches as such, instead of read-only prefetchlloyd2009-12-291-1/+1
|
* Kill buf_op - was basically the prototype for Buffering_Filter.lloyd2009-12-283-176/+0
| | | | | | It would be useful in its own right, many other things need to do hashing, but the tr1 dependency kills it right now. Something to revisit in the C++0x branch, perhaps?
* propagate from branch 'net.randombit.botan' (head ↵lloyd2009-12-273-0/+176
|\ | | | | | | | | | | 5749645b3dc61c94f9b2980aa7773a3849105a81) to branch 'net.randombit.botan.buf-op' (head 7c1f7c88bd4d016ff49f098e47ac6032ff43041b)
| * propagate from branch 'net.randombit.botan' (head ↵lloyd2009-12-273-0/+176
| |\ | | | | | | | | | | | | | | | 79ed5b0f9057b2d40335e268fdb9f375837d1d11) to branch 'net.randombit.botan.buf-op' (head 87160704bdc30b0a4cb19fd4516e20e85dca2869)
| | * Add a generalized Buffered_Operation. Relies on tr1 for sane callbackslloyd2009-12-273-0/+176
| | | | | | | | | | | | (std::tr1::function).
* | | Add debug source to build. Fix typo in source.lloyd2009-12-272-2/+1
|/ /
* / Add debug.h which is an internal-only header with debug functions thatlloyd2009-12-273-0/+65
|/ | | | I tend to rewrite often in particular files while debugging things.
* Add/fix doxygen commentslloyd2009-12-241-5/+12
|
* Replace time_t_to_tm with calendar_value which returns a struct representinglloyd2009-12-242-6/+24
| | | | the calendar time without tying to a particular format. From the C++0x branch.
* Wrap up whatever we're using for gmtime in an anon-namespace function do_gmtimelloyd2009-12-241-14/+19
|
* Fix compile of get_nanoseconds_clock for Windows.lloyd2009-12-231-2/+12
| | | | | | | Add macros for OS support of gmtime_r (Unix) and gmtime_s (Win32) to deal with thread-unsafety of std::gmtime. Only enable gmtime_r on Linux currently, but it's probably available pretty much everywhere (specified in pthreads, origininally, AFAICT).
* Add a static_cast<byte>() around get_byte just to keep VC++ quiet.lloyd2009-12-231-1/+3
|
* Use unaligned reads/writes in xor_buf.h - bad macro name!lloyd2009-12-231-2/+2
|
* Deal with unknown or mixed endian architectures properly. If known littlelloyd2009-12-231-22/+18
| | | | | | or big endian, for large loads always memcpy, then go back and swap as needed. Otherwise (unknown or mixed endian) just load one at a time as usual.
* Add bswap_4 which swaps 4 Ts in parallel. Normally just uses reverse_bytes,lloyd2009-12-231-0/+50
| | | | | but if SSE2 or SSSE3 is available uses SIMD magic to swap 4 32 bit values at once.
* Add GetSystemTimeAsFileTime as high res timer for Win32lloyd2009-12-221-7/+21
|
* Fix simd_32 loadstor includeslloyd2009-12-222-3/+3
|
* Un-internal loadstor.h (and its header deps, rotate.h andlloyd2009-12-215-20/+27
| | | | | | | | | | | | | | 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).
* Add missing BOTAN_DLL exports.lloyd2009-12-162-7/+9
| | | | Move most of the engine headers to internal
* Make many more headers internal-only.lloyd2009-12-1610-18/+20
| | | | | | | | | | | | | 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-169-17/+59
|
* Consolidate the non-canonical epoch timers, like cpuid and Win32'slloyd2009-12-013-1/+118
| | | | | | | | | | | | | | QueryPerformanceCounter, into an entropy source hres_timer. Its results, if any, do not count as contributing entropy to the poll. Convert the other (monotonic/fixed epoch) timers to a single function get_nanoseconds_clock(), living in time.h, which statically chooses the 'best' timer type (clock_gettime, gettimeofday, std::clock, in that order depending on what is available). Add feature test macros for clock_gettime and gettimeofday. Remove the Timer class and timer.h. Remove the Timer& argument to the algorithm benchmark function.
* Make sure the SIMD_32 implementation we're using actually works on thelloyd2009-11-243-3/+3
| | | | system before returning a new instance.
* Instead of having two asm_macr.h files being switched in based on modulelloyd2009-11-144-8/+0
| | | | build magic, name them asm_macr_ARCH.h. Change all including files accordingly.
* Use memcpy for bulk loads if algorithm endianness matches CPU endianess.lloyd2009-11-101-0/+9
|
* Also #undef bool after including <altivec.h>lloyd2009-11-101-0/+1
|
* Rename CPUID::has_intel_aes to has_aes_intel, and add CPUID::has_aes_via,lloyd2009-11-101-2/+11
| | | | which is currently just a stub returning false.
* Tick to 1.9.3-devlloyd2009-11-063-28/+15
| | | | | Rename BOTAN_UNALIGNED_LOADSTOR_OK to BOTAN_UNALIGNED_MEMORY_ACCESS_OK which is somewhat more clear as to the point.
* Add an andc operation, in SSE2 and AltiVec, may be useful for Serpent sboxeslloyd2009-11-044-4/+22
|
* Slight cleanups in the Altivec detection code for readability.lloyd2009-10-291-5/+12
|
* Add a new looping load_be / load_le for loading large arrays at once, andlloyd2009-10-291-0/+46
| | | | | | | | 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).
* Fix cpuid with icc (tested with 11.1)lloyd2009-10-291-2/+2
| | | | | Document SHA optimizations, AltiVec runtime checking, fixes for cpuid for both icc and msvc.
* Give each version of SIMD_32 a public bswap()lloyd2009-10-293-11/+29
|
* Add new function enabled() to each of the SIMD_32 instantiations which lloyd2009-10-293-1/+9
| | | | | returns true if they might plausibly work. AltiVec and SSE2 versions call into CPUID, scalar version always works.
* No ||= operator!lloyd2009-10-291-7/+7
|
* Add CPUID::have_altivec for AltiVec runtime detection.lloyd2009-10-292-0/+61
| | | | | Relies on mfspr emulation/trapping by the kernel, which works on (at least) Linux and NetBSD.
* Use register writes in the Altivec code for stores because Altivec's handlinglloyd2009-10-291-7/+16
| | | | | | for unaligned writes is messy as hell. If writes are batched this is somewhat easier to deal with (somewhat).
* Kill realnames on new modules not in mailinelloyd2009-10-291-2/+0
|
* propagate from branch 'net.randombit.botan' (head ↵lloyd2009-10-295-0/+575
|\ | | | | | | | | | | 8fb69dd1c599ada1008c4cab2a6d502cbcc468e0) to branch 'net.randombit.botan.general-simd' (head c05c9a6d398659891fb8cca170ed514ea7e6476d)
| * Add copyright + license on the new SIMD fileslloyd2009-10-284-2/+14
| |
| * Add an AltiVec SIMD_32 implementation. Tested and works for Serpent and XTEAlloyd2009-10-281-0/+178
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on a PowerPC 970 running Gentoo with GCC 4.3.4 Uses a GCC syntax for creating literal values instead of the Motorola syntax [{1,2,3,4} instead of (1,2,3,4)]. In tests so far, this is much, much slower than either the standard scalar code, or using the SIMD-in-scalar-registers code. It looks like for whatever reason GCC is refusing to inline the function: SIMD_Altivec(__vector unsigned int input) { reg = input; } and calls it with a branch hundreds of times in each function. I don't know if this is the entire reason it's slower, but it definitely can't be helping. The code handles unaligned loads OK but assumes stores are to an aligned address. This will fail drastically some day, and needs to be fixed to either use scalar stores, which (most?) PPCs will handle (if slowly), or batch the loads and stores so we can work across the loads. Considering the code so far loads 4 vectors of data in one go this would probably be a big win (and also for loads, since instead of doing 8 loads for 4 registers only 5 are needed).
| * Define SSE rotate_right in terms of rotate left, and load_be in termslloyd2009-10-281-3/+2
| | | | | | | | of load_le + bswap
| * Add subtraction operators to SIMD_32 classes, needed for XTEA decryptlloyd2009-10-262-0/+26
| |
| * Add a wrapper for a set of SSE2 operations with convenient syntax for 4x32lloyd2009-10-264-0/+360
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | operations. Also add a pure scalar code version. Convert Serpent to use this new interface, and add an implementation of XTEA in SIMD. The wrappers plus the scalar version allow SIMD-ish code to work on all platforms. This is often a win due to better ILP being visible to the processor (as with the recent XTEA optimizations). Only real danger is register starvation, mostly an issue on x86 these days. So it may (or may not) be a win to consolidate the standard C++ versions and the SIMD versions together. Future work: - Add AltiVec/VMX version - Maybe also for ARM's NEON extension? Less pressing, I would think. - Convert SHA-1 code to use SIMD_32 - Add XTEA SIMD decryption (currently only encrypt) - Change SSE2 engine to SIMD_engine - Modify configure.py to set BOTAN_TARGET_CPU_HAS_[SSE2|ALTIVEC|NEON|XXX] macros
* | Remove the 'realname' attribute on all modules and cc/cpu/os info files.lloyd2009-10-295-10/+0
|/ | | | | Pretty much useless and unused, except for listing the module names in build.h and the short versions totally suffice for that.
* Add ; after call to VC++'s __cpuid, not a macrolloyd2009-10-251-1/+1
|