aboutsummaryrefslogtreecommitdiffstats
path: root/src/math
Commit message (Collapse)AuthorAgeFilesLines
* Shuffle things around. Add NIST X.509 test to build.lloyd2014-01-0151-8875/+0
|
* Give everything setting a feature test macro in build.h a version codelloyd2013-11-284-4/+4
| | | | | | so application code can check for the specific API it expects without having to keep track of what versions APIs x,y,z changed. Arbitrarily set all current API versions to 20131128.
* Revert accidental deletelloyd2013-07-301-0/+18
|
* Rename mp_asm.h to mp_madd.hlloyd2013-07-3017-38/+21
|
* Merge mp_word64 into mp_genericlloyd2013-07-305-95/+52
| | | | | | Now 64-bit limbs can be used regardless of processor, though we continue to use 32-bit unless we know the processor natively supports 64-bit operations.
* Add a generic 64x64->128 multiplication op.lloyd2013-07-306-213/+66
| | | | | | | Use it to merge mp_msvc64 (was using MSVC _umul128 intrinsic) and mp_asm64 (was using inline asm) into mp_word64, which calls the new mul64x64_128 function. That function wraps any available compiler intrinsics or CPU instructions.
* Avoid putting dword typedef in global namespacelloyd2012-09-041-5/+5
|
* Avoid conditionals in the power mod opslloyd2012-09-042-22/+35
|
* Fix various issues flagged by cppcheck. Nothing too interesting.lloyd2012-08-131-1/+1
|
* Use m_ namespace member vars in CurveGFplloyd2012-08-011-35/+36
|
* Move monty_invert to numthry.h and use it in CurveGFp as welllloyd2012-08-014-51/+48
|
* Remove z_size parameter to bigint_monty_redc because it should alwayslloyd2012-08-014-26/+12
| | | | | | | | | | | be 2*(p_size+1). Document that it clears the high part of z. Don't clear the workspace before calling Karatsuba in bigint_mul or bigint_sqr - they clear it every time anyway. Don't bother masking words in the Montgomery_Exponentiator as redc zeros those words. Also don't bother calling z.clear() as the multiply operation does that already.
* Cleanup BigInt::cmplloyd2012-08-014-41/+43
| | | | | | Move bigint_divcore to divide.cpp which is the only place it is used. Probably not computationally intensive enough to really be worth optimizing in asm.
* Move all BigInt constructors to the top of the decllloyd2012-08-011-81/+82
|
* Remove BigInt::assignlloyd2012-08-012-25/+24
|
* Remove BigInt(NumberType type, size_t n) and replace it with a staticlloyd2012-08-018-36/+23
| | | | BigInt function power_of_2. (Power2 was the only available NumberType)
* Remove all support for octal BigInt conversions.lloyd2012-08-014-39/+25
|
* Remove BigInt::get_reglloyd2012-08-012-11/+4
|
* Remove BigInt::operator[]. Use BigInt::word_at, which checks sizeslloyd2012-08-014-14/+12
|
* Remove BigInt::operator[] returning a mutable word referencelloyd2012-08-013-13/+9
|
* Rename the version of BigInt::data returning a mutable pointerlloyd2012-08-015-38/+38
| | | | to BigInt::mutable_data. Update callers.
* Remove the mutable version of BigInt::get_reglloyd2012-07-315-22/+18
|
* m_ namespace BigInt memberslloyd2012-07-313-40/+40
|
* Remove BigInt::grow_reg which was only used by a few tests.lloyd2012-07-312-14/+4
|
* Doxygen commentslloyd2012-07-061-3/+22
|
* Increase default Miller-Rabin nonce to 192 bitslloyd2012-06-261-2/+2
|
* Be explicit about swap template specializationlloyd2012-06-261-1/+1
|
* Remove BOTAN_MEM_POOL_CHUNK_SIZE macro from build.h, no longer used.lloyd2012-06-191-5/+8
| | | | | Move Karatsuba cutoffs to mp_karat.cpp as that is the only place that uses them and I doubt these get tweaked much (ever).
* In Karatsuba multiplication, we would avoid recursing in cases wherelloyd2012-06-191-48/+10
| | | | | | | | | we know one of the sub values was going to be zero. Avoid doing this as it exposes a timing channel. Some bn_asm code was manually inlined into the Karatsuba for doing additions. Just call the normal functions - if these are too slow that should be fixed.
* Use the extended Euclidean algorithm for computing the inverse forlloyd2012-06-171-10/+57
| | | | | | | Montgomery exponentiation as except for the very first division all operands are single words and thus we can assume we have a relatively fast division operation (and additionally working only with words avoids dynamic allocation).
* Use a special case for odd moduli in inverse_mod with close to doublelloyd2012-06-171-1/+51
| | | | performance.
* inverse_mod - avoid mutable zero_bits, avoid making needless copies oflloyd2012-06-171-11/+12
| | | | the arguments
* m_ namespace member varslloyd2012-06-152-44/+42
|
* Index, comments, name vars in headerslloyd2012-06-153-5/+15
|
* Computing the Montgomery parameter can be done much cheaper because welloyd2012-06-151-3/+4
| | | | | | | only need the low word of the result. Credits to HAC, somehow I missed that this was possible. This helps especially when a program does a lot of setups, so the improvement is only minor on the benchmark but fairly huge for asio_tls_server.
* Plain hex_decode now returns a std::vector, use hex_decode_locked tolloyd2012-05-261-6/+6
| | | | get a secure_vector.
* For block and stream ciphers, don't set the size of the key vectorslloyd2012-05-252-3/+2
| | | | | | | | | | | until we are actually setting a key. This avoids the problem of prototype objects consuming not just memory but the precious few bytes of mlock'able memory that we're given by Linux. Use clear_mem instead of a loop in BigInt::mask_bits If OS2ECP encounters an invalid format type, include what type it was in the exception message.
* Replace 0 and NULL pointer constants with nullptr. Also fix an oldlloyd2012-05-181-4/+4
| | | | style cast in secmem.h
* Fairly huge update that replaces the old secmem types with std::vectorlloyd2012-05-1814-107/+141
| | | | | | 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-13/+2
| | | | secmem.h. Mostly replaced by assign or copy_mem.
* propagate from branch 'net.randombit.botan.tls-state-machine' (head ↵lloyd2012-04-251-1/+1
|\ | | | | | | | | | | a4741cd07f50a9e1b29b0dd97c6fb8697c038ade) to branch 'net.randombit.botan.cxx11' (head 116e5ff139c07000be431e07d3472cc8f3919b91)
| * Avoid a few maintainer mode flag warnings. Remove -Weffc++ from thelloyd2012-04-201-1/+1
| | | | | | | | | | list of maintainer mode flags. It produces some very useful warnings, but also a lot of noisy junk that I really don't care about.
* | propagate from branch 'net.randombit.botan' (head ↵lloyd2012-02-201-2/+0
|\| | | | | | | | | | | c247a55e7c0bcd239fcfc672139b59ef63d7ee84) to branch 'net.randombit.botan.cxx11' (head 16d7756c6b8933d0d543ebdda9c7e8f4908a4a33)
| * Remove debug printfs, stdio includeslloyd2012-01-301-2/+0
| |
* | Fixes for GCC 4.7.0 (r183974)lloyd2012-02-071-1/+3
| |
* | propagate from branch 'net.randombit.botan' (head ↵lloyd2011-12-182-640/+639
|\| | | | | | | | | | | 39f53266912f33dc48e942b1b865ddcd6af66d8d) to branch 'net.randombit.botan.cxx11' (head 0bf26cec09f71e75c547b4ec53365748c6d80d86)
| * Fix declarationlloyd2011-11-181-2/+1
| |
| * Manually rename registers instead of rotating. Performance is aboutlloyd2011-11-181-638/+638
| | | | | | | | | | the same, so clearly GCC 4.6 and/or the Core i7 are very good about renames, but might help on less capable systems.
* | propagate from branch 'net.randombit.botan' (head ↵lloyd2011-06-176-21/+64
|\ \ | |/ |/| | | | | | | 5dc30d88afdeec4896b5065f9260e66d52b1a730) to branch 'net.randombit.botan.cxx11' (head 8d42792537db92fab3136f5696ee1eba3e73fa76)
| * Inline BigInt move operators and swaplloyd2011-06-133-34/+49
| | | | | | | | Add move constructor and assignment to PointGFp