aboutsummaryrefslogtreecommitdiffstats
path: root/src/math
Commit message (Collapse)AuthorAgeFilesLines
* 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
| * propagate from branch 'net.randombit.botan' (head ↵lloyd2011-06-135-8/+36
| |\ | | | | | | | | | | | | | | | 150bd11dd8090559ee1e83394b8283bf93a018de) to branch 'net.randombit.botan.c++0x' (head 7480693bb3f1e8a4e039a3e7ba3d9a7007f9730e)
| | * propagate from branch 'net.randombit.botan' (head ↵lloyd2011-02-115-8/+36
| | |\ | | | | | | | | | | | | | | | | | | | | 13a0d36dac3709f3cb88e830ed7f8cab9e7433ab) to branch 'net.randombit.botan.c++0x' (head 2221ad8796466e7e096645de77ba856a9c902d14)
| | | * propagate from branch 'net.randombit.botan' (head ↵lloyd2010-11-045-8/+36
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | 303b2518a80553214b1e5ab4d9b96ef54629cbc7) to branch 'net.randombit.botan.c++0x' (head d734eefabe4816be4dd3e3e6e7bb13b7ab5be148)
| | | | * propagate from branch 'net.randombit.botan' (head ↵lloyd2010-10-285-11/+9
| | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2841fb518e20d2fe0a374e4f6b08bdbb14d5d158) to branch 'net.randombit.botan.c++0x' (head 0b9275139d6346bd3aa28d63bf8b8a03851d853d)
| | | | * \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-10-135-8/+36
| | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2898d79f992f27a328a3e41d34b46eb1052da0de) to branch 'net.randombit.botan.c++0x' (head 6cba76268fd69a73195760c021b7f881b8a6552c)
| | | | | * \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-09-035-8/+36
| | | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a29c41b4a949207b1544096c3afab668f8b5179e) to branch 'net.randombit.botan.c++0x' (head a9d0c2f805b3c20a4c648575d7256959db8329fe)
| | | | | | * \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-08-135-8/+36
| | | | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 0a3348f52bf558bc2282e1066c2913a72a1aeda5) to branch 'net.randombit.botan.c++0x' (head 552c20ae8874f12da779fc25ea368e36e71cbfe8)
| | | | | | | * \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-07-095-8/+36
| | | | | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 161b5c0300b72baa746f101fda1e2b4a7c71818c) to branch 'net.randombit.botan.c++0x' (head 1fc3875bb8daf4ad0e90ba66db72642203cb9984)
| | | | | | | | * \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-06-222-21/+116
| | | | | | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 647eeb4f4cf8fa4cf487cdc463d48f09fe18658e) to branch 'net.randombit.botan.c++0x' (head 2539675db91883b11895ddc5244721e93c413321)
| | | | | | | | * \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-06-1712-95/+263
| | | | | | | | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 294e2082ce9231d6165276e2f2a4153a0116aca3) to branch 'net.randombit.botan.c++0x' (head 0b695fad10f924601e07b009fcd781191fafcb28)
| | | | | | | | * \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-03-215-11/+43
| | | | | | | | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 96d0a1885774b624812fd143d541c8bcda319217) to branch 'net.randombit.botan.c++0x' (head e14368ab9d7976f3e111c6bc0adf24eebeb7c114)
| | | | | | | | | * \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-03-132-27/+74
| | | | | | | | | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8f918e9ea99aebd6f685b1fbdddb77564e724744) to branch 'net.randombit.botan.c++0x' (head 23d15f23e7fd97436b93f99fb59ba18b9f13210b)
| | | | | | | | | * \ \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-03-135-11/+43
| | | | | | | | | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5e9c6107cbb15744c2edf2eb0e23f4bfe949f432) to branch 'net.randombit.botan.c++0x' (head 79e5920a8bba479b9e5734f8649b8c36d27d403c)
| | | | | | | | | | * \ \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-03-095-11/+43
| | | | | | | | | | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9932d4d63417f7fcc199ada244cbaa6c1c32d9c1) to branch 'net.randombit.botan.c++0x' (head f4a385a376311edc62ef506c72cc56f69e6efd5a)
| | | | | | | | | | | * \ \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-03-023-67/+57
| | | | | | | | | | | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fc86fc4842254088bf820ea6ebf05877aa63fb22) to branch 'net.randombit.botan.c++0x' (head 77565ff7252df7f8faad86d65075498b0adb93d8)
| | | | | | | | | | | * \ \ \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-02-255-11/+43
| | | | | | | | | | | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | c1db52e38b60afbc6549af5222d6e10b1b9730dd) to branch 'net.randombit.botan.c++0x' (head e56dfbfe6bffbd5b4e52b115549d885c5fd04586)
| | | | | | | | | | | | * | | | | | Post-merge fixupslloyd2010-02-241-1/+1
| | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | * | | | | | propagate from branch 'net.randombit.botan' (head ↵lloyd2010-02-247-1092/+302
| | | | | | | | | | | | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2b67727dd9d1e7fe34f3cb7b7f6715ba42a04918) to branch 'net.randombit.botan.c++0x' (head 1e2e1596f2b4928c2b7bfba624ea5e4ac69dfdad)
| | | | | | | | | | | | * \ \ \ \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-02-1412-63/+86
| | | | | | | | | | | | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5bfc3e699003b86615c584f8ae40bd6e761f96c0) to branch 'net.randombit.botan.c++0x' (head 8c64a107b58d41f376bfffc69dfab4514d722c5c)
| | | | | | | | | | | | | * \ \ \ \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-01-2112-63/+86
| | | | | | | | | | | | | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 12382647ef0a28fcb11c824c77b670cc88a4f721) to branch 'net.randombit.botan.c++0x' (head b586a3286d2c4d547ad3add5af9df1455bf4b87b)
| | | | | | | | | | | | | | * \ \ \ \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2009-12-241-2/+0
| | | | | | | | | | | | | | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 367d157c1221a162f5b4098492944a509ef6d019) to branch 'net.randombit.botan.c++0x' (head 1b9e8c4e92663f30b7d57b0fd8f57eb13cfce155)
| | | | | | | | | | | | | | * \ \ \ \ \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2009-12-2112-63/+86
| | | | | | | | | | | | | | |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 14c1d4dc8696d2705a70ec3d2403e01d2ca95265) to branch 'net.randombit.botan.c++0x' (head c567fa7310ba082a837562092728c4b4b882bf82)
| | | | | | | | | | | | | | | * \ \ \ \ \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2009-12-1612-63/+86
| | | | | | | | | | | | | | | |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 22c82e10d78ad0e2cdaa56cb02f3d846ed0ead5e) to branch 'net.randombit.botan.c++0x' (head 74dbf310b7fcc11f94a16cd63046219acd5d62bc)
| | | | | | | | | | | | | | | | * | | | | | | | Post-merge fixeslloyd2009-12-161-8/+0
| | | | | | | | | | | | | | | | | | | | | | | |