aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Cast the u32bit output array to an int* when calling the VC++ intrinsic,lloyd2009-10-251-3/+6
| | | | | | | since it passes signed ints for whatever reason. Ensure CALL_CPUID is always defined (previously, it would not be if on an x86 but compiled with something other than GCC, ICC, VC++).
* Add new store_[l|b]e variants taking 8 values.lloyd2009-10-231-16/+108
| | | | | | Add new load options that are passed a number of variables by reference, setting them all at once. Will allow for batching operations (eg using SIMD operations to do 128-bit wide bswaps) for future optimizations.
* Enable CPUID on x86 (checking wrong macro name)lloyd2009-10-211-1/+1
|
* In to_u32bit, ignore space characters in inputlloyd2009-10-061-0/+3
|
* Clean up cpuid callinglloyd2009-10-061-32/+26
|
* Disable prefetch in AES for now. Problem: with iterative modes like CBC,lloyd2009-09-301-12/+0
| | | | | | | | the prefetch is called for each block of input, and so a total of (4096+256)/64 = 68 prefetches are executed for each block. This reduces performance of iterative modes dramatically. I'm not sure what the right approach for dealing with this is.
* Add cpuid check for Intel AESlloyd2009-09-301-1/+8
|
* Add vendor ID for AMDlloyd2009-09-291-1/+1
|
* Significantly rework CPUID support. Add cache line detectionlloyd2009-09-292-87/+99
|
* Change the prefetching interface; move to PREFETCH namespace, and add alloyd2009-09-291-9/+25
| | | | helper function for fetching both inputs and outputs of block ciphers.
* Remove add block from utils/info.txtlloyd2009-09-291-27/+0
|
* Add some basic prefetching support (only supported with GNU C++ or thingslloyd2009-09-294-3/+44
| | | | | that claim to be by defining __GNUG__ (such as Intel C++)) in new utils header prefetch.h
* merge of '1efb42e84eca9e01edd7b7f1335af7011eab994c'lloyd2009-09-253-0/+161
|\ | | | | | | and 'bb55abb64b64ca63aeb361db40c6bc4692d4ce48'
| * Add runtime cpuid support. Check in the SSE2 engine that SSE2 is actuallylloyd2009-09-253-0/+161
| | | | | | | | existing on the current CPU before returning an object.
* | Add engine deps on the asm_xxx modules so the engines get loadedlloyd2009-09-242-0/+8
| |
* | propagate from branch 'net.randombit.botan.1_8' (head ↵lloyd2009-09-176-110/+70
|\| | | | | | | | | | | 1f4729658b70a340064bc9a33c923a44ecab84d8) to branch 'net.randombit.botan' (head b9ca6596a127964cb9795d22bc2a5642fab5de84)
| * Split up util.h into 3 fileslloyd2009-09-173-65/+4
| | | | | | | | | | | | | | - rounding.h (round_up, round_down) - workfactor.h (dl_work_factor) - timer.h (system_time) And update all users of the previous util.h
| * Move memory locking function decls to mlock.hlloyd2009-09-175-25/+46
| | | | | | | | Inline round_up and round_down
* | Fix macro generation + checks in configure.py and bswap.h. Had the effectlloyd2009-09-171-2/+2
|/ | | | of preventing the bswap optimizations from being used. :(
* Add a new option --no-autoload to configure.py. This will produce a minimallloyd2009-09-041-1/+1
| | | | | | | | | | | build (only libstate, utils, plus dependencies), which can be extended with use of --enable-modules. To add new modules to the set of always-loaded, use 'load_on always' in info.txt Also fix a few small build problems that popped up when doing a minimal build. Requested by a user.
* Fix variable name in 32-bit bswap for VC++lloyd2009-08-031-1/+1
|
* A typo in a macro check in bswap.h meant inline asm bswap was notlloyd2009-07-311-1/+1
| | | | used on Visual C++
* Add missing info.txt fileslloyd2009-07-162-0/+24
|
* Correct source listings for moved fileslloyd2009-07-161-2/+0
|
* Move some files around to break up dependencies between directorieslloyd2009-07-169-958/+0
|
* Add a script that reads the output of print_deps.py and rewriteslloyd2009-07-151-4/+6
| | | | | | the info.txt files with the right module dependencies. Apply it across the codebase.
* Remove unnecessary includes of <iostream>; either delete entirely as notlloyd2009-07-111-2/+0
| | | | needed, or replace with <iosfwd> or <ostream> where necessary.
* Move mutex.h from utils/ to mutex/ dir as more relevant arealloyd2009-07-012-57/+0
|
* DataSource::discard_next did not actually return the number of discardedlloyd2009-06-241-1/+1
| | | | bytes. Bug noted by Falko Strenzke, fix by M. Braun. (bug id 31)
* Use an input insensitive implementation of same_mem instead of memcmp.lloyd2009-06-221-1/+8
| | | | | | I don't know that having same_mem be sensitive to input would actually allow any form of timing attack in the current codebase, but it seemed like a prudent thing to do in any case.
* Many source files included bit_ops.h when what was really desired waslloyd2009-05-131-1/+0
| | | | | rotate.h, or when it was not needed at all. Remove or change the includes as needed.
* Include <algorithm> in secmem.h for std::swaplloyd2009-04-081-0/+1
|
* Add a new version of SCAN_Name::arg that returns a default value if thelloyd2009-03-312-2/+17
| | | | param isn't set.
* Thomas Moschny passed along a request from the Fedora packagers which camelloyd2009-03-3032-500/+564
| | | | | | | | | | | | | | | 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).
* Use u32bit instead of int for loop counter in ctzlloyd2009-03-271-1/+1
|
* propagate from branch 'net.randombit.botan' (head ↵lloyd2009-01-313-63/+0
|\ | | | | | | | | | | 4518ef63a5e28e22a61d21a6066d0d4a5cf0616e) to branch 'net.randombit.botan.entropy-poll-redesign' (head c8e07f10a193b25bab726af99ea2ea77a0f30eaf)
| * Check in a branch with a major redesign on how entropy polling is performed.lloyd2009-01-273-63/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Combine the fast and slow polls, into a single poll() operation. Instead of being given a buffer to write output into, the EntropySource is passed an Entropy_Accumulator. This handles the RLE encoding that xor_into_buf used to do. It also contains a cached I/O buffer so entropy sources do not individually need to allocate memory for that with each poll. When data is added to the accumulator, the source specifies an estimate of the number of bits of entropy per byte, as a double. This is tracked in the accumulator. Once the estimated entropy hits a target (set by the constructor), the accumulator's member function predicate polling_goal_achieved flips to true. This signals to the PRNG that it can stop performing polling on sources, also polls that take a long time periodically check this flag and return immediately. The Win32 and BeOS entropy sources have been updated, but blindly; testing is needed. The test_es example program has been modified: now it polls twice and outputs the XOR of the two collected results. That helps show if the output is consistent across polls (not a good thing). I have noticed on the Unix entropy source, occasionally there are many 0x00 bytes in the output, which is not optimal. This also needs to be investigated. The RLE is not actually RLE anymore. It works well for non-random inputs (ASCII text, etc), but I noticed that when /dev/random output was fed into it, the output buffer would end up being RR01RR01RR01 where RR is a random byte and 00 is the byte count. The buffer sizing also needs to be examined carefully. It might be useful to choose a prime number for the size to XOR stuff into, to help ensure an even distribution of entropy across the entire buffer space. Or: feed it all into a hash function? This change should (perhaps with further modifications) help WRT the concerns Zack W raised about the RNG on the monotone-dev list.
* | A new warning in glibc triggers if memset is called with a constant sizelloyd2009-01-311-8/+8
|/ | | | | | | | | | of 0 (on the theory this is a mistake and the second and third arguments were swapped). However the GCC inliner apparently is good enough that it is triggering on code that just happens to create a zero length SecureVector or equivalent - the constants get propagated so __builtin_constant_p returns true. Add an if(n) in clear_mem so we skip calling memset if the size is zero.
* Use a simple run length encoding in xor_into_buf, so long blocks of spaces,lloyd2008-11-232-3/+22
| | | | | zero bytes, etc (relatively common, especially with the statistical pollers that use xor_into_buf) are removed. Counters wrap at 256.
* Pass by const reference so larger structs can be used with xor_into_buf templatelloyd2008-11-231-1/+1
|
* Move xor_into_buf to xor_buf.cpp. Also add a new template wrapper forlloyd2008-11-233-10/+39
| | | | xoring integer values in.
* Add xor_into_buf. Add Doxygen comments for xor_buflloyd2008-11-231-10/+32
|
* Remove support for provider identifiers from SCAN_Name - it turns out thislloyd2008-11-122-37/+5
| | | | | | | | | | | | was not the right place to keep track of this information. Also modify all Algorithm_Factory constructor functions to take instead of a SCAN_Name a pair of std::strings - the SCAN name and an optional provider name. If a provider is specified, either that provider will be used or the request will fail. Otherwise, the library will attempt best effort, based on user-set algorithm implementation settings (combine with benchmark.h for choosing the fastest implementation at runtime) or if not set, a static ordering (preset in static_provider_weight in prov_weight.cpp, though it would be nice to make this easier to toggle).
* Drop use of entropy estimation in Randpool for the same reason as HMAC_RNG.lloyd2008-11-113-130/+0
| | | | | | As with HMAC_RNG, instead assume one bit of conditional entropy per byte of polled material. Since they are no longer used, drop the entropy estimation routines entirely.
* Move utils/{timer,mutex} to toplevellloyd2008-11-1127-782/+0
|
* Rename timers.h to timer.hlloyd2008-11-117-7/+7
|
* Throw an exception if SCAN name is malformed or emptylloyd2008-11-111-0/+3
|
* Remove support for multiple providers in SCAN_Name, mostly because Illoyd2008-11-112-32/+19
| | | | couldn't really figure out how the semantics should work.