aboutsummaryrefslogtreecommitdiffstats
path: root/src/math
Commit message (Collapse)AuthorAgeFilesLines
* 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
| | | | | | | | | |
| | | | | | * | | | propagate from branch 'net.randombit.botan' (head ↵lloyd2009-12-1642-131/+149
| | | | | | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 744dccf92270cf16b80b50ee2759424c9866b256) to branch 'net.randombit.botan.c++0x' (head 2aa1acac1d05e8ea9991fe39015b1db9abc3b24e)
| | | | | | * | | | | Define move assignment and constructors in terms of std::swap (whichlloyd2009-11-191-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | boils down to BigInt::swap, which uses the memvec swap). Checking with g++ 4.5 -O3 shows it compiles down the same code as before.
| | | | | | * | | | | Add move assignment and constructor operators to BigInt. On macro benchmarkslloyd2009-11-192-4/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (timing the test suite) there doesn't seem to be much of a difference either way, but putting printfs in the implementations shows they are being used. Since they pretty much can't possibly hurt (right?) and might well help a lot in certain cases, it's worth including. Todo: adding overloads to binary operators taking move operations might be nice. Details in http://cpp-next.com/archive/2009/09/making-your-next-move/
| | | | | | * | | | | Remove to_string, replacing with std::to_stringlloyd2009-11-182-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert to_u32bit to use the new C++0x library func stoul instead of hand-written code.
| | | | | | * | | | | propagate from branch 'net.randombit.botan' (head ↵lloyd2009-11-189-55/+46
| | | | | | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 23f95467137a0531f74574d1e3eb822734f0c5f2) to branch 'net.randombit.botan.c++0x' (head 427be8496e669880b1bf532eb829ebbdbeaf34c9)
| | | | | | | * | | | | Remove accidentally checked in change to powm_fw.cpplloyd2009-11-181-29/+6
| | | | | | | | | | | |
| | | | | | | * | | | | Use async in ElGamal encryption and Nyberg-Rueppel verificationlloyd2009-11-181-6/+29
| | | | | | | | | | | |
| | | | | | | * | | | | propagate from branch 'net.randombit.botan' (head ↵lloyd2009-11-172-6/+6
| | | | | | | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cfb19182987fc95b2a8885584a38edb10b4709b3) to branch 'net.randombit.botan.c++0x' (head 1570877c463fed4b632bc49a5b5ee27c57de2cb5)
| | | | | | | * \ \ \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2009-11-163-3/+3
| | | | | | | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8cecdc1c3dd5853823fabcb816400dd467b3c04a) to branch 'net.randombit.botan.c++0x' (head 39a585195a07f18628f6216a276402ed92567cc3)
| | | | | | | * | | | | | | Remove TR1 hooks - can be assumed to exist under a C++0x compilerlloyd2009-11-131-3/+1
| | | | | | | | | | | | | |
| | | | | | | * | | | | | | Make `struct mapping tests[]` non-static in miller_rabin_test_iterationslloyd2009-11-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to work around gcc bug 42010
| | | | | | | * | | | | | | propagate from branch 'net.randombit.botan' (head ↵lloyd2009-11-136-42/+23
| | | | | | | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ac888e57b614c623590d79ab615353ad7c76ef68) to branch 'net.randombit.botan.c++0x' (head 9bf78ed7e2521a328f6db7acbc1cd81b07718230)
| | | | | | | * \ \ \ \ \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2009-11-027-51/+44
| | | | | | | |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2773c2310e8c0a51975987a2dd6c5824c8d43882) to branch 'net.randombit.botan.c++0x' (head f13cf5d7e89706c882604299b508f356c20aae3a)
| | | | | | | | * \ \ \ \ \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2009-10-137-51/+44
| | | | | | | | |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 139d6957d20f0b1202e0eacc63cb011588faffde) to branch 'net.randombit.botan.c++0x' (head c16676fa6c393bc3f46a044755ce525a013380a6)
| | | | | | | | | * \ \ \ \ \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2009-09-172-2/+2
| | | | | | | | | |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 92e05ab242e4b6998d685961c53700534a673bce) to branch 'net.randombit.botan.c++0x' (head 27ce37b971ec5cb1f80a9a95b13d5a951b96653b)
| | | | | | | | | * \ \ \ \ \ \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2009-09-087-51/+44
| | | | | | | | | |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5cadcc57872bef55226579df57349fe09a93d1f5) to branch 'net.randombit.botan.c++0x' (head d1747f0394aa4442e5b32b9102b830e1a86f0e5a)
| | | | | | | | | | * \ \ \ \ \ \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2009-07-216-31/+36
| | | | | | | | | | |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 95eb8083f5884531e5ca0667388f8a6fb6d05c41) to branch 'net.randombit.botan.c++0x' (head 56e105e678540c8bcafa4d0198c19a9489fbf8d1)
| | | | | | | | | | * \ \ \ \ \ \ \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2009-07-157-51/+44
| | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5438defd358f82e876917a8bd6d735305ecb0a8e) to branch 'net.randombit.botan.c++0x' (head cbdb2fd418557add29a536f7bdb6e78db16f725c)
| | | | | | | | | | | * \ \ \ \ \ \ \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2009-07-031-1/+1
| | | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | d6d32791adfa878b6fc0dd3a5b65a665b7bbb549) to branch 'net.randombit.botan.c++0x' (head 54deb0e078aab8cd91c8fd8819d1e6668fc762da)
| | | | | | | | | | | * \ \ \ \ \ \ \ \ \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2009-06-047-51/+44
| | | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6a746ccf1e957dba703e65372050a7bd4d6b117d) to branch 'net.randombit.botan.c++0x' (head f54bb7b391eb3b71f380a68ddd460debdc31545d)
| | | | | | | | | | | | * | | | | | | | | | | Use C++0x std::shared_ptr<> instead of TR1'slloyd2009-04-016-50/+43
| | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | * | | | | | | | | | | Replace the (deprecated) auto_ptr with unique_ptr.lloyd2009-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was mostly a s/auto_ptr/unique_ptr/, except in the CVC code and one function in ECDSA, which relied on auto_ptr's move semantics (ugh) and had to be modified in various ways.
* | | | | | | | | | | | | | | | | | | | | | | Deconstify PK_Ops. It's quite reasonable that some op will want tolloyd2010-03-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | precompute only as needed, or will want to access some other expensive resource or etc. Change how the secret for generating blinding is done in cases where a PRNG isn't available. Use the operations public op to hide the secret, for instance the seed for a DH blinding variable is 2^x mod p. Make use of being able to mutate internal structures in the RW signer, since that does have access to a PRNG, so use it to initialize the blinder on first call to sign().
* | | | | | | | | | | | | | | | | | | | | | | Consolidate code for choosing a window size for fixed width windowlloyd2010-03-094-72/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | exponentiation algorithms.
* | | | | | | | | | | | | | | | | | | | | | | Add back in blinding to RSA, RW, ElGamal, and DH.lloyd2010-03-083-85/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are multiple unsatisfactory elements to the current solution, as compared to how blinding was previously done: Firstly, blinding is only used in the baseline implementations; the code using OpenSSL and GMP is not protected by blinding at all. Secondly, at the point we need to set up blinding, there is no access to a PRNG. Currently I am going with a quite nasty solution, of using a private key parameter to seed a simple PRNG constructed as: SHA-512(TS1 || private_key_param || public_key_param || TS2) I really want to fix both of these elements but I'm not sure how to do so easily.
* | | | | | | | | | | | | | | | | | | | | | | Inline Engine_Core::mod_exp into singler caller, and deletelloyd2010-03-051-2/+19
| | | | | | | | | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | | | | | | | Make the modulus visible in Modular_Reducerlloyd2010-03-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | | | | | | | Force high bit in random_prime as well (done by randomize currently, but ↵lloyd2010-03-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | might not be later)
* | | | | | | | | | | | | | | | | | | | | | | Clarify exception text on get_affine when point is zerolloyd2010-03-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | | | | | | | Make two variants of OS2ECP, one taking pointer + length, and otherlloyd2010-03-022-13/+19
| |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (inlined) taking a MemoryRegion& that just forwards. This makes it possible to avoid an extra copy in ECDH::derive_key.
* | | | | | | | | | | | | | | | | | | | | | Inline some simple PointGFp functionslloyd2010-03-022-51/+35
| | | | | | | | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | | | | | | Rename PointGFp::get_jac_proj_{x,y,z} simply get_{x,y,z}lloyd2010-03-021-3/+3
| | | | | | | | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | | | | | | Allow creating uninitialized PointGFp and CurveGFpslloyd2010-03-012-0/+10
| | | | | | | | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | | | | | | Rename mult2_in_place just mult2 (double would be better but is a keyword...)lloyd2010-03-012-6/+6
| | | | | | | | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | | | | | | Simplify mult2_in_place slightlylloyd2010-02-251-7/+3
|/ / / / / / / / / / / / / / / / / / / / /
* | | | | | | | | | | | | | | | | | | | | Move contents of gfpmath to numbertheory. Adjust dependencies.lloyd2010-02-255-15/+3
| | | | | | | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | | | | | Delete gfp_element.h and remove the gfpmath testslloyd2010-02-252-250/+0
| | | | | | | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | | | | | Hide MillerRabin_Test class (only used in numthry.cpp)lloyd2010-02-256-84/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inline simple functions in Modular_Reducer Add Modular_Reducer::cube convenience function
* | | | | | | | | | | | | | | | | | | | | Cache the Modular_Reducer of p in CurveGFp; speedup of 3-4xlloyd2010-02-252-8/+11
| | | | | | | | | | | | | | | | | | | | |