Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Avoid more VC warnings | lloyd | 2010-12-13 | 1 | -2/+2 |
| | |||||
* | Avoid a conditional in point multiplication | lloyd | 2010-12-07 | 1 | -11/+7 |
| | |||||
* | Use append operator instead of copy | lloyd | 2010-12-07 | 1 | -21/+16 |
| | |||||
* | Compile fix | lloyd | 2010-11-02 | 1 | -1/+1 |
| | |||||
* | Doxygen | lloyd | 2010-11-02 | 1 | -2/+1 |
| | |||||
* | Make MemoryRegion::set protected, change all callers | lloyd | 2010-10-29 | 1 | -4/+4 |
| | |||||
* | BigInt::get_substring really shouldn't return size_t. Revert to | lloyd | 2010-10-18 | 3 | -7/+5 |
| | | | | | | u32bit. Maybe should be word? But that would restrict window sizes more than might be desirable (we couldn't use more than 8 bit window on the assumption that the lib might be using byte limbs). Messy. | ||||
* | Use output_length() instead of OUTPUT_LENGTH pseudo-property | lloyd | 2010-10-13 | 1 | -1/+1 |
| | |||||
* | Use size_t in all of math, remove to_u32bit | lloyd | 2010-10-12 | 16 | -93/+93 |
| | |||||
* | Tidy | lloyd | 2010-09-30 | 1 | -1/+2 |
| | |||||
* | Modify bigint_monty_redc to take an additional workspace argument. | lloyd | 2010-09-24 | 3 | -44/+53 |
| | | | | | | | Modify it to avoid a timing condition during the compare at the end; this is done by always doing the subtraction, and then copying to the output either the pre-subtraction or post-subtraction value depending on if the final borrow was set or not. | ||||
* | More vector->pointer conversion removals. | lloyd | 2010-09-13 | 1 | -3/+1 |
| | | | | | | | | | | | Add RandomNumberGenerator::random_vec, which takes an length n and returns a new SecureVector with randomized contents of that size. This nicely covers most of the cases where randomize was being called on a vector, and is a little cleaner in the code as well, instead of vec.resize(length); rng.randomize(&vec[0], vec.size()); we just write vec = rng.random_vec(length); | ||||
* | First set of changes for avoiding use implicit vector->pointer conversions | lloyd | 2010-09-13 | 2 | -7/+7 |
| | |||||
* | Anywhere where we use MemoryRegion::begin to get access to the raw pointer | lloyd | 2010-09-13 | 2 | -12/+12 |
| | | | | | 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 at | lloyd | 2010-09-07 | 2 | -6/+6 |
| | | | | | | | | | | | | | | 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. | ||||
* | Avoid name clashing, Sun Studio doesn't like this | lloyd | 2010-09-07 | 1 | -2/+3 |
| | |||||
* | Make round_up and round_down templates instead of fixed to use u32bits | lloyd | 2010-06-29 | 1 | -1/+1 |
| | |||||
* | Doxygen | lloyd | 2010-06-22 | 1 | -5/+17 |
| | |||||
* | Doxygen | lloyd | 2010-06-21 | 1 | -3/+7 |
| | |||||
* | Doxygen | lloyd | 2010-06-21 | 1 | -13/+92 |
| | |||||
* | More Doxygen | lloyd | 2010-06-16 | 1 | -2/+9 |
| | |||||
* | More Doxygen updates. Also, don't expose divide() in numthry.h | lloyd | 2010-06-16 | 1 | -12/+48 |
| | | | | anymore, only in divide.h | ||||
* | More Doxygen updates/fixes | lloyd | 2010-06-15 | 4 | -7/+21 |
| | |||||
* | Replace PointGFp::check_invaraints, which would either return silently | lloyd | 2010-03-19 | 2 | -13/+17 |
| | | | | | | | | | | | or throw an exception, with PointGFp::on_the_curve, which returns a bool. Update callers. This showed several cases where check_invaraints was being called multiple times, for instance when decoding a point with OS2ECP, check_invaraints was called; many callers of OS2ECP would then call check_invaraints again on the same object. | ||||
* | A number of changes to primality tests: | lloyd | 2010-03-19 | 5 | -167/+45 |
| | | | | | | | | | | | | | | Use 64 bit nonces in the Miller-Rabin test, instead of 40 bits. Rename check_prime to quick_check_prime and is_prime to check_prime Remove some internal functions which weren't used outside the primality test code, along with the prime products table. For quick checking, instead of doing Miller-Rabin with fixed base 2, do a small number of randomized tests. Always use random bases instead of the first n primes. | ||||
* | The logic PointGFp::operator*= was basically doing | lloyd | 2010-03-16 | 2 | -29/+31 |
| | | | | | | | | | *this = scalar * *this; And operator* was doing a needless copy. Instead make operator* a real multiplication operation, define *= in terms of it. | ||||
* | Shuffle functions for easier reading | lloyd | 2010-03-16 | 2 | -74/+75 |
| | |||||
* | Fix include. <botan/mp_core.h> was picking up the system installed version, | lloyd | 2010-03-16 | 1 | -1/+1 |
| | | | | which happened to be compatible enough to work. | ||||
* | Various microoptimizations, 5-12% improvement | lloyd | 2010-03-15 | 1 | -8/+15 |
| | |||||
* | Use a 4-bit wide window for point multiplication | lloyd | 2010-03-15 | 1 | -14/+21 |
| | |||||
* | Rewrite point mult to make larger windows easier | lloyd | 2010-03-15 | 1 | -7/+14 |
| | |||||
* | Strength reduce on multiplies in PointGFp | lloyd | 2010-03-15 | 1 | -4/+5 |
| | |||||
* | Cache memory used for operations in point | lloyd | 2010-03-15 | 1 | -16/+18 |
| | |||||
* | Modify to allow better memory caching | lloyd | 2010-03-15 | 2 | -21/+52 |
| | |||||
* | Cache p.sig_words() in curve object | lloyd | 2010-03-15 | 3 | -27/+68 |
| | | | | Avoid using Barett reduction in core operations; seems to help perf. | ||||
* | Use bigint_{mul,sqr} in PointGFp monty ops | lloyd | 2010-03-15 | 2 | -9/+8 |
| | |||||
* | Add PointGFp::monty_sqr | lloyd | 2010-03-15 | 2 | -10/+44 |
| | |||||
* | Cache BigInts as well. Kind of like the old scheme, but created inside | lloyd | 2010-03-13 | 2 | -27/+74 |
| | | | | operator+= and operator*= instead of being class var, so no thread issues. | ||||
* | Always keep coord_{x,y,z} < p, so don't ever have to copy or use reducer | lloyd | 2010-03-13 | 1 | -22/+10 |
| | | | | in monty_mult() | ||||
* | Save workspace for addition calls inside operator*= | lloyd | 2010-03-13 | 2 | -20/+28 |
| | |||||
* | Share workspace among calls to mult2 | lloyd | 2010-03-13 | 2 | -10/+9 |
| | |||||
* | Cache a workspace; much faster | lloyd | 2010-03-13 | 2 | -31/+43 |
| | |||||
* | Small optimizations | lloyd | 2010-03-13 | 1 | -6/+13 |
| | | | | | Especially try to keep the size of inputs down, so it doesn't have to do an extra reduction step. Ideally this should be eliminated entirely. | ||||
* | Kill stdio include | lloyd | 2010-03-13 | 1 | -2/+0 |
| | |||||
* | Unroll point multiply to look at two bits of scalar each iteration. | lloyd | 2010-03-13 | 1 | -2/+24 |
| | | | | Helps out quite a bit. | ||||
* | Precompute a*r | lloyd | 2010-03-13 | 2 | -2/+9 |
| | |||||
* | More monty_mult cleanups | lloyd | 2010-03-13 | 1 | -6/+4 |
| | |||||
* | Small monty_mult cleanup | lloyd | 2010-03-13 | 1 | -10/+8 |
| | |||||
* | Inline/simplifiy monty mult | lloyd | 2010-03-13 | 1 | -31/+15 |
| | |||||
* | Single word p-dash | lloyd | 2010-03-13 | 1 | -3/+4 |
| |