aboutsummaryrefslogtreecommitdiff
path: root/src/test/canonical_tests.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make SCRIPT_VERIFY_STRICTENC compatible with BIP62Pieter Wuille2014-10-081-113/+0
| | | | | | | | * Delete canonical_tests.cpp, and move the tests to script_tests.cpp. * Split off SCRIPT_VERIFY_DERSIG from SCRIPT_VERIFY_STRICTENC (the BIP62 part of it). * Change signature STRICTENC/DERSIG semantics to fail the script entirely rather than the CHECKSIG result (softfork safety, and BIP62 requirement). * Add many autogenerated tests for several odd cases. * Mention specific BIP62 rules in the script verification flags.
* Separate script/interpreterjtimon2014-09-081-1/+3
|
* Rename script.h/.cpp to scriptutils.h/.cpp (plus remove duplicated includes)jtimon2014-09-081-1/+1
|
* move rand functions from util to new random.h/.cppPhilip Kaufmann2014-07-091-5/+3
|
* Merge pull request #3637Wladimir J. van der Laan2014-05-091-0/+17
|\ | | | | | | 6fd7ef2 Also switch the (unused) verification code to low-s instead of even-s. (Pieter Wuille)
| * Also switch the (unused) verification code to low-s instead of even-s.Pieter Wuille2014-03-101-0/+17
| | | | | | | | | | | | | | | | a81cd968 introduced a malleability breaker for signatures (using an even value for S). In e0e14e43 this was changed to the lower of two potential values, rather than the even one. Only the signing code was changed though, the (for now unused) verification code wasn't adapted.
* | Add licenses for tests and test dataWladimir J. van der Laan2014-03-181-0/+4
|/ | | | | | | | - Add license headers to source files (years based on commit dates) in `src/test` as well as `qa` - Add `README.md` to `src/test/data` specifying MIT license Fixes #3848
* Cleanup code using forward declarations.Brandon Dahler2013-11-101-4/+7
| | | | | | | | | Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files.
* included-tests: generate binary data from test files for inclusion into test ↵Cory Fields2013-09-161-3/+5
| | | | | | | | | | | | | | | | | | | | | | binaries This change moves test data into the binaries rather than reading them from the disk at runtime. Advantages: - Tests become distributable - Cross-compile friendly. Build on one machine and execute in an arbitrary location on another. - Easier testing for backports. Users can verify that tests pass without having to track down corresponding test data. - More trustworthy test results and easier quality assurance as tests make fewer assumptions about their environment. - Tests could theoretically run at client/daemon startup and exit on failure. Disadvantages: - Required 'hexdump' build-dependency. This is a standard bsd tool that should be usable everywhere. It is likely already installed on all build-machines. - Tests can no longer be fudged after build by altering test-data.
* Only create signatures with even S, and verification mode to check.Pieter Wuille2013-08-161-2/+2
| | | | | | | | | | | | | | | | | To fix a minor malleability found by Sergio Lerner (reported here: https://bitcointalk.org/index.php?topic=8392.msg1245898#msg1245898) The problem is that if (R,S) is a valid ECDSA signature for a given message and public key, (R,-S) is also valid. Modulo N (the order of the secp256k1 curve), this means that both (R,S) and (R,N-S) are valid. Given that N is odd, S and N-S have a different lowest bit. We solve the problem by forcing signatures to have an even S value, excluding one of the alternatives. This commit just changes the signing code to always produce even S values, and adds a verification mode to check it. This code is not enabled anywhere yet. Existing tests in key_tests.cpp verify that the produced signatures are still valid.
* Check for canonical public keys and signaturesPieter Wuille2012-09-211-0/+87
Only enabled inside tests for now.