Commit Graph

695 Commits

Author SHA1 Message Date
Sean Bowe f5e5707d4c Change memo field size and relocate `ciphertexts` field of JoinSplit description. 2016-08-15 09:39:14 -06:00
Jack Grigg b5c06c83b0 Consistent parameter naming 2016-08-12 14:37:17 +12:00
Robert C. Seacord 47251e8460 Update test_equihash.cpp 2016-08-10 22:02:00 -04:00
Jack Grigg 7c929cf5bc Add support for spending keys to the basic key store 2016-08-09 17:38:25 +12:00
zkbot 0822971120 Auto merge of #1183 - bitcartel:zc.v0.11.2.latest_txid_tests, r=bitcartel
Add gtest for non-malleable txids.

1. Test txid of normal transaction is double sha256 with sigscript input data removed
2. Test txid of coinbase transaction is double sha256 over whole tx

You can run a single test with:
./zcash-gtest --gtest_filter="txid_tests*"
2016-08-06 21:47:23 +00:00
Simon 2a7fde3f42 Add test for non-malleable txids. To run just this test:
./zcash-gtest --gtest_filter="txid_tests*"
2016-08-05 22:54:21 -07:00
Jack Grigg fa19e1b357 Add test showing bug in IsProbablyDuplicate() 2016-08-06 15:23:47 +12:00
Jack Grigg 51eb5273f5 Equihash: Pass each obtained solution to a callback for immediate checking
Closes #1143
2016-07-27 19:15:49 +12:00
zkbot 6dfc9e7a7c Auto merge of #1120 - str4d:1055-asynchronous-miner-interrupts, r=str4d
Make Equihash solvers cancellable

The miner only cancels the solver when chainActive.Tip() changes.

Closes #1055
2016-07-25 23:51:23 +00:00
Jack Grigg 1655db285d Move initialisations to simplify cancelled checks 2016-07-22 23:54:14 +12:00
Sean Bowe 4d66f8f68a Add test for non-intuitive merkle tree gadget witnessing behavior. 2016-07-21 19:28:58 -06:00
Jack Grigg 5b4ebcd5e2 Add tests that exercise the cancellation code branches 2016-07-21 16:39:32 +12:00
Sean Bowe 1d184d53e1 Rename cacheSerials to cacheNullifiers and fix tests. 2016-07-18 10:06:18 -06:00
Sean Bowe 8f95cd3c26 Test fixes. 2016-07-18 10:06:18 -06:00
Sean Bowe 8675d94b63 Rename vpour to vjoinsplit. 2016-07-18 10:06:18 -06:00
Sean Bowe a8c68ffe99 Rename CPourTx to JSDescription. 2016-07-18 10:06:18 -06:00
zkbot fc127fc2db Auto merge of #1051 - ThisIsNotOfficialCodeItsJustForks:t863-mock-coverage-of-checktransaction, r=ebfull
Add mock test coverage of CheckTransaction

Closes #863.
2016-07-14 18:43:07 +00:00
Taylor Hornby a4944ffcb0 Fix bad_txns_oversize test for increased block size. 2016-07-14 12:17:01 -06:00
Sean Bowe 2668a1bc13 Remove the rest of libzerocash. 2016-07-10 20:25:02 -06:00
Taylor Hornby d9ee9a51d1 Test non-canonical ed25519 signature check 2016-06-23 18:22:20 -06:00
Taylor Hornby 4aea53423e More testing of CheckTransaction 2016-06-23 16:59:00 -06:00
Taylor Hornby 948d4e6c10 Split JoinSplit proof verification out of CheckTransaction. 2016-06-23 16:35:31 -06:00
Taylor Hornby cea9f58791 WIP: Add mock test coverage of CheckTransaction 2016-06-22 17:25:35 -06:00
Taylor Hornby fc057da455 Add example mock test of CheckTransaction 2016-06-15 17:01:55 -06:00
Sean Bowe 6ab0a227c6 Fix test against merkle tree root. 2016-06-15 15:31:14 -06:00
zkbot 8ff7c0752e Auto merge of #954 - ebfull:fix-cpourtx-structure, r=ebfull
CPourTx structural changes

* Enable binary serialization of proofs and the proving key (closes #799) and make the proofs fixed-size.
* Reorder fields of CPourTx to match the spec (closes #927)
2016-05-25 16:33:31 +00:00
Sean Bowe 9285bba885 Enable binary serializations of proofs and r1cs keys, and make the `CPourTx` proof field fixed-size. 2016-05-24 11:08:31 -06:00
Sean Bowe defe37a6d4 Enforce first four bits are zero for all spending keys and phi. 2016-05-24 11:07:09 -06:00
Taylor Hornby bf2e3122ac Remove the Merkle tree hash function's fixed point. 2016-05-16 20:20:36 -06:00
zkbot 9e387120eb Auto merge of #908 - ebfull:trafford, r=ebfull
libzcash and new zkSNARK circuit implementation

This PR completes [`libzcash`](https://github.com/zcash/zcash/tree/zc.v0.11.2.latest/src/zcash), the implementation of the [Zcash protocol specification](9bb4410e45/protocol/protocol.pdf) and replacement of [`libzerocash`](https://github.com/Zerocash/libzerocash), our old Zerocash protocol implementation. The new spec comes with some improvements to security and terminology, with minimal differences from the original academic design.

This implementation includes:

* A rewrite of the zkSNARK circuit for `JoinSplit` operations. This rewrite is cleaner, broken up into separate gadgets, easier to audit and review, and fixes some security bugs. (Closes #822, Closes #809, Closes #500, Closes #854)
* A minimal API for interacting with `JoinSplit`s and surrounding primitives. This PR removes almost twice as much code as it introduces. (Closes #877, Closes #315, Closes #824, Closes #798, Closes #707, Closes #512, Closes #247, Closes #128, Closes #514)
2016-05-17 01:04:49 +00:00
Sean Bowe 1896a89cac Add h_sig test vectors. 2016-05-12 16:45:12 -06:00
Sean Bowe 81469bbb83 `Note` values should be little-endian byte order. 2016-05-12 16:45:12 -06:00
Sean Bowe a9640f67f1 Rename ZCASH_ constants to ZC_. 2016-05-12 16:45:07 -06:00
Sean Bowe 0d990f31a7 Stop testing old tree against new tree. 2016-05-12 16:44:49 -06:00
Sean Bowe 5a2db9e283 libzcash: Add tests for API 2016-05-12 16:44:30 -06:00
Sean Bowe c75d6bd0fa Initialize libsodium in the gtest suite. 2016-05-10 17:46:58 -06:00
Sean Bowe 5961dcb6da Change ciphertext length to match protocol spec, and refactor the use of constants. 2016-05-05 21:02:03 -06:00
zkbot 92f3c6082a Auto merge of #889 - ebfull:new-imt-redux, r=ebfull
Implement and integrate new Incremental Merkle Tree

This supersedes #823.

----

This is an implementation of a new incremental merkle tree with

* no memory safety issues
* a more sensible internal design
* better space efficiency (tree representation, witnessing)
* simpler API

It is intended that this tracks the behavior of the previous tree, which it does, as verified by tests. I even wrote a little circuit for testing that all the paths work.

This PR also integrates the tree into the codebase and deprecates the old tree in almost all of our code. (I left it alone in `zerocashTest` but everything else has been changed.)

This change is compatible with the testnet but you will need to clear your *local* blockchain data out since the serialized representation of the merkle tree is now different.

Closes #517, Closes #519, Closes #591, Closes #460, Closes #473
2016-05-03 17:33:27 +00:00
Sean Bowe 4b2c67d212 Check exception has specific string message. 2016-04-28 19:35:22 -06:00
Sean Bowe 984bdd88f1 Add additional tests for ephemeral key behavior. 2016-04-28 16:52:22 -06:00
Sean Bowe 57f118176f Move NoteEncryption tests to gtest suite. 2016-04-28 16:25:14 -06:00
Sean Bowe 6850b45e4d Move incremental merkle tree tests to zcash-gtest. 2016-04-28 16:10:21 -06:00
Taylor Hornby 0000d23121 Add empty merkle/noteencryption tests so Sean can rebase. 2016-04-28 10:10:40 -06:00
Taylor Hornby 6ad4db2253 Add check that vpubs are not both nonzero and test it. 2016-04-27 14:12:30 -06:00
Nathan Wilcox 3ab0c1a790 Add a zcash-gtest binary to our build with a single tautological test. 2016-04-18 11:14:30 -07:00