aboutsummaryrefslogtreecommitdiffstats
path: root/checks/ec_tests.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Plain hex_decode now returns a std::vector, use hex_decode_locked tolloyd2012-05-261-61/+61
| | | | get a secure_vector.
* Fairly huge update that replaces the old secmem types with std::vectorlloyd2012-05-181-59/+59
| | | | | | 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.
* propagate from branch 'net.randombit.botan' (head ↵lloyd2011-06-131-2/+2
|\ | | | | | | | | | | 150bd11dd8090559ee1e83394b8283bf93a018de) to branch 'net.randombit.botan.c++0x' (head 7480693bb3f1e8a4e039a3e7ba3d9a7007f9730e)
| * propagate from branch 'net.randombit.botan' (head ↵lloyd2011-02-111-2/+2
| |\ | | | | | | | | | | | | | | | 13a0d36dac3709f3cb88e830ed7f8cab9e7433ab) to branch 'net.randombit.botan.c++0x' (head 2221ad8796466e7e096645de77ba856a9c902d14)
| | * propagate from branch 'net.randombit.botan' (head ↵lloyd2010-10-131-2/+2
| | |\ | | | | | | | | | | | | | | | | | | | | 2898d79f992f27a328a3e41d34b46eb1052da0de) to branch 'net.randombit.botan.c++0x' (head 6cba76268fd69a73195760c021b7f881b8a6552c)
| | | * propagate from branch 'net.randombit.botan' (head ↵lloyd2010-09-031-2/+2
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | a29c41b4a949207b1544096c3afab668f8b5179e) to branch 'net.randombit.botan.c++0x' (head a9d0c2f805b3c20a4c648575d7256959db8329fe)
| | | | * propagate from branch 'net.randombit.botan' (head ↵lloyd2010-03-211-2/+2
| | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 96d0a1885774b624812fd143d541c8bcda319217) to branch 'net.randombit.botan.c++0x' (head e14368ab9d7976f3e111c6bc0adf24eebeb7c114)
| | | | | * propagate from branch 'net.randombit.botan' (head ↵lloyd2010-03-131-2/+2
| | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5e9c6107cbb15744c2edf2eb0e23f4bfe949f432) to branch 'net.randombit.botan.c++0x' (head 79e5920a8bba479b9e5734f8649b8c36d27d403c)
| | | | | | * propagate from branch 'net.randombit.botan' (head ↵lloyd2010-03-091-2/+2
| | | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9932d4d63417f7fcc199ada244cbaa6c1c32d9c1) to branch 'net.randombit.botan.c++0x' (head f4a385a376311edc62ef506c72cc56f69e6efd5a)
| | | | | | | * propagate from branch 'net.randombit.botan' (head ↵lloyd2010-03-021-40/+38
| | | | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fc86fc4842254088bf820ea6ebf05877aa63fb22) to branch 'net.randombit.botan.c++0x' (head 77565ff7252df7f8faad86d65075498b0adb93d8)
| | | | | | | * \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-02-251-2/+2
| | | | | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | c1db52e38b60afbc6549af5222d6e10b1b9730dd) to branch 'net.randombit.botan.c++0x' (head e56dfbfe6bffbd5b4e52b115549d885c5fd04586)
| | | | | | | | * \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-02-241-33/+10
| | | | | | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2b67727dd9d1e7fe34f3cb7b7f6715ba42a04918) to branch 'net.randombit.botan.c++0x' (head 1e2e1596f2b4928c2b7bfba624ea5e4ac69dfdad)
| | | | | | | | * \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2010-01-211-5/+5
| | | | | | | | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 12382647ef0a28fcb11c824c77b670cc88a4f721) to branch 'net.randombit.botan.c++0x' (head b586a3286d2c4d547ad3add5af9df1455bf4b87b)
| | | | | | | | | * \ \ propagate from branch 'net.randombit.botan' (head ↵lloyd2009-12-161-1/+0
| | | | | | | | | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 744dccf92270cf16b80b50ee2759424c9866b256) to branch 'net.randombit.botan.c++0x' (head 2aa1acac1d05e8ea9991fe39015b1db9abc3b24e)
| | | | | | | | | * | | | Use C++0x std::shared_ptr<> instead of TR1'slloyd2009-04-011-3/+3
| | | | | | | | | | | | |
| | | | | | | | | * | | | Replace the (deprecated) auto_ptr with unique_ptr.lloyd2009-04-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | | | | | | | Modify ECC points to do all math in Montgomery form, rather thanlloyd2011-05-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | converting back and forth. This gives a 10 to 20% speedup on a Core i7. In addition, the CurveGFp no longer contains a Barrett reducer, saving 3 BigInts worth of memory. Add a #if'ed out alternative to point multiplication using the Montgomery ladder technique. It runs in (more or less) constant time, but rather significantly slower than the 4 bit window technique currently used. Tweak the window sizes to match the theoretical optimums.
* | | | | | | | | | | | | Fix building the tests when ECC is turned off.lloyd2011-05-171-2/+13
| | | | | | | | | | | | |
* | | | | | | | | | | | | ECC private keys had two different constructors, one taking a grouplloyd2011-04-081-9/+9
|/ / / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and a random number generator, and the other taking a group and a preset private key value. The DL private keys instead have on constructor for this; if the x value is zero, then a new random key is created. For consistency, do this with ECC as well. ECDH actually didn't have one of these constructors, forcing you to either load from PKCS #8 or else use a random key. Rename EC_Domain_Params to EC_Group, with a typedef for compatability. More doc updates. Update mtn ignores for Sphinx output
* / / / / / / / / / / / Remove inclusions of unused headers.lloyd2011-02-101-1/+1
|/ / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid using auto_ptr in the CVC headers.
* | | | | | | | | | | Remove more uses of vector to pointer implicit conversionslloyd2010-09-131-5/+1
| | | | | | | | | | |
* | | | | | | | | | | Anywhere where we use MemoryRegion::begin to get access to the raw pointerlloyd2010-09-131-38/+38
|/ / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | representation (rather than in an interator context), instead use &buf[0], which works for both MemoryRegion and std::vector
* / / / / / / / / / Use the standalone version of the hex decoder instead of the wrapper thatlloyd2010-09-031-54/+54
|/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | previously existed in misc.cpp that emulated it via a pipe and filter.
* / / / / / / / / Replace PointGFp::check_invaraints, which would either return silentlylloyd2010-03-191-14/+18
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | | Simple cleanupslloyd2010-03-131-6/+13
| | | | | | | |
* | | | | | | | Remove access to the Jacobian coordinate getters get_{x,y,z}, as welllloyd2010-03-131-136/+59
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | as the 4-argument constructor. Define operator==() in terms of the affine coordinates. Rewrite tests that assumed access to the Jacobian coodinates in terms of the affine coordinates. This change allows for using arbitrary coordinate systems in PointGFp, as long as it can convert to the normal affine coordinates (which are what is used by all ECC algorithms implemented currently, and probably all interesting ECC algorithms in general).
* | | | | | | Remove the sign() operation from the public key objects, totally replacedlloyd2010-03-051-80/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | by using the ops. Add real ECDSA test vectors (two found in ANSI X9.62)
* | | | | | | Avoid warnings under VC++ in ECC testslloyd2010-03-031-1/+1
| |_|_|_|_|/ |/| | | | |
* | | | | | Rename PointGFp::get_jac_proj_{x,y,z} simply get_{x,y,z}lloyd2010-03-021-32/+32
| | | | | |
* | | | | | Kill get_EC_Dom_Pars_by_oidlloyd2010-03-011-8/+6
|/ / / / /
* | | | | Change create_random_point to use Modular_Reducerlloyd2010-02-251-11/+9
| | | | |
* | | | | Remove another useless EC testlloyd2010-02-251-33/+0
| | | | |
* | | | | Remove a useless EC test (was testing mres)lloyd2010-02-251-34/+0
| | | | |
* | | | | create_random_point was used in one tests though, so add it back in ec_tests.cpplloyd2010-02-251-0/+25
| | | | |
* | | | | Make PointGFp::mult2_in_place privatelloyd2010-02-251-22/+17
| | | | |
* | | | | CurveGFp: Inline, deleting source file. Store only a,b,p aslloyd2010-02-251-24/+26
| | | | | | | | | | | | | | | | | | | | | | | | | BigInts. Also reorder constructor args to p, a, b which seems more sensible to me.
* | | | | Convert the PointGFp constructor taking three coordinates (Jacobian scheme)lloyd2010-02-251-30/+9
| | | | | | | | | | | | | | | | | | | | to take BigInts instead of GFpElements
* | | | | Convert PointGFp::get_jac_proj_{x,y,z} to return just the BigInt value,lloyd2010-02-251-87/+32
| | | | | | | | | | | | | | | | | | | | not a GFpElement
* | | | | Convert PointGFp::get_affine_{x,y} to return just the BigInt valuelloyd2010-02-251-61/+17
| | | | |
* | | | | Convert 3-arg constructoor of PointGFp to take BigInts instead oflloyd2010-02-251-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GFpElements. Clean up OS2ECP
* | | | | Kill dead codelloyd2010-02-251-24/+4
| | | | |
* | | | | Remove the montgomery optimizations from GFpElement entirely.lloyd2010-02-241-29/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes things even slower than they were before, but will make refactoring easier. And most of the montgomery code there was duplicates of other code that already existed in the codebase. Anything useful can be pulled back out from history later if needed.
* | | | | Remove PointGFp::mult_this_securelloyd2010-02-241-25/+2
| |_|_|/ |/| | |
* | | | Remove use of tr1 entirely from gfpmath.lloyd2010-02-231-33/+10
|/ / / | | | | | | | | | | | | | | | | | | Remove a handful of tests which were based on testing the sharing aspects, which are gone now; everything is based on value copies. All tests pass on x86-64 with GCC. Valgrind output looks clean too.
* | / Add copyright and license notes to pretty much every file that didn't have them,lloyd2009-12-311-0/+6
| |/ |/| | | | | | | | | | | | | including the examples and self-test code. Most of these files had not copyright/license information at all; since a major point of the examples is to allow users to copy and paste code that already does something they want, an ambigious license is not good.
* | Full working amalgamation build, plus internal-only headers concept.lloyd2009-12-161-1/+0
|/
* Disable ec_tests.cpp unless ECDSA is enabledlloyd2008-11-171-1/+13
|
* Reorganize all GF(p)/ECC tests to be called from pk.cpplloyd2008-11-171-1/+1
|
* Output that ECC tests are being run, and run them after GF(p) math tests ↵lloyd2008-11-171-0/+4
| | | | which is a reasonable ordering
* Tame ec_tests.cpp and integrate it into the test code.lloyd2008-11-171-1115/+1120
| | | | | | | | I'm seeing one failure on Core2. Have not diagnosed at all. A number of tests are #if'ed out. Many were rubbed out in the original InSiTo version, others I commented out due to changed/removed APIs.