Commit Graph

297 Commits

Author SHA1 Message Date
Jack Grigg 5799c5f8c0
Add test for -mempooltxinputlimit 2017-06-17 14:59:16 +12:00
Jack Grigg 1b786a93c3
Add test for incorrect consensus logic 2017-06-16 13:45:14 +12:00
Sean Bowe 9eb9eebbb8 Check that pairings work properly when the G1 point is at infinity. 2017-05-23 16:31:41 -06:00
Jack Grigg 5b3bc9716e Implement automatic shutdown of deprecated Zcash versions
Closes #2274.
2017-05-12 14:41:46 +12:00
Daira Hopwood 60b7410cce Add check for JoinSplit priority as calculated by CCoinsViewCache::GetPriority.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-04-13 22:40:37 +01:00
str4d c83c5932e4 Add unit test for security issue 2017-04-11.a 2017-04-13 17:59:36 +01:00
Jack Grigg 601f00f6fb
Add AtomicTimer tests 2017-03-25 13:06:00 +13:00
Jack Grigg 5c0d105b6b
Update LocalSolPS test 2017-03-25 12:57:22 +13:00
Simon 1003180260 Keep first three original testnet fr addresses so existing coinbase
transactions on testnet remain valid during upgrade.  New addresses
will be used starting from block 53127.
2017-02-22 11:04:17 -08:00
Simon 4340ec9705 Update founders reward addresses for testnet 2017-02-20 09:23:06 -08:00
Simon 2911b35712 Fix bug where test was generating but not saving keys to wallet on disk. 2017-02-20 09:23:06 -08:00
Jack Grigg 2cc6bab201
Update UniValue includes in Zcash-specific code 2017-02-10 02:19:06 +00:00
Jack Grigg 02972a1bcd
[cleanup] Simplify test code 2017-02-10 00:53:15 +00:00
Jack Grigg 5fb326d41d
Manually iterate over UniValue arrays in tests 2017-02-10 00:53:09 +00:00
Jack Grigg 0d37ae3a59
Migrate Zcash-specific code to UniValue 2017-02-10 00:52:57 +00:00
zkbot 0c78782662 Auto merge of #1965 - str4d:1955-single-address-mining, r=bitcartel
Switch miner to P2PKH, add -mineraddress option

Closes #945 and #1955.
2017-02-09 20:58:00 +00:00
zkbot 80a32b2845 Auto merge of #1863 - str4d:1795-config-flag-disable-miner, r=bitcartel
Add compile flag to disable compilation of mining code

Closes #1795
2017-02-09 17:43:43 +00:00
Jack Grigg 8e8b6d701b
Switch miner to P2PKH, add -mineraddress option
Closes #945 and #1955.
2017-02-06 11:54:58 +00:00
Jack Grigg 51fde9ea08
Use a more specific exception class for note decryption failure
Closes #1545.
2017-01-31 23:05:19 +01:00
Jack Grigg 2cc0a252ad
Add compile flag to disable compilation of mining code 2017-01-30 21:14:46 +01:00
zkbot a6ba873aa8 Auto merge of #1949 - str4d:1810-fix-disablewallet, r=str4d
Fix --disablewallet

Closes #1810.
2017-01-09 17:36:41 +00:00
Sean Bowe fc538ec2ea Add test for IncrementalMerkleTree::size(). 2016-12-16 13:50:55 -07:00
Jack Grigg 6daab5b4fc
Only run wallet tests when wallet is enabled 2016-12-16 10:52:37 +13:00
zkbot 152c0ebf21 Auto merge of #1938 - ebfull:g2-subgroup-check, r=str4d
Additional well-formedness check for G2 elements

libsnark currently checks that G<sub>1</sub> and G<sub>2</sub> elements are well-formed by ensuring that they satisfy their respective curve equations, and although this is enough for G<sub>1</sub> (which is instantiated as an order r curve E/F<sub>p</sub>: y^2 = x^3 + b), G<sub>2</sub> is the order r *subgroup* of the composite order r(2q-r) curve E'/Fp<sup>2</sup>: y^2 = x^3 + b/e constructed via a sextic twisting isomorphism. This means we need to ensure these points are order r as well.

None of the proofs on the Zcash blockchain violate this check, and it may not even be possible for them to violate this check (bilinearity is not preserved). Let's be cautious and do it anyway.
2016-12-13 11:26:23 +00:00
Sean Bowe c4fce3fc81 Check that E' points are actually in G2 by ensuring they are of order r. 2016-12-12 19:14:42 -07:00
Jack Grigg 6fb8d0c2d6
Skip JoinSplit verification before the last checkpoint
Part of #1749
2016-12-09 21:06:45 +13:00
zkbot a398121503 Auto merge of #1919 - ebfull:abstract-verification, r=str4d
Isolate verification to a ProofVerifier context object that allows verification behavior to be tuned by the caller.

This is an alternative foundation for #1892, i.e., #1892 will have to be changed if this PR is accepted.

I think this is a safer approach because it allows us to isolate verification behavior to a single object. This will come in handy when @arielgabizon finishes the batching code.
2016-12-09 06:22:53 +00:00
Sean Bowe 37cce214a4 ASSERT_TRUE -> ASSERT_FALSE 2016-12-08 23:14:23 -07:00
Sean Bowe 690171e268 Add more tests for ProofVerifier. 2016-12-08 12:47:41 -07:00
Sean Bowe bc59f53722 Isolate verification to a `ProofVerifier` context object that allows verification behavior to be tuned by the caller. 2016-12-05 12:40:06 -07:00
Jack Grigg 000499ae64
Add getlocalsolps and getnetworksolps RPC calls, show them in getmininginfo 2016-11-16 22:02:49 +13:00
zkbot 54218ea05c Auto merge of #1797 - ebfull:improve-joinsplit-diagnostics, r=bitcartel
Improve joinsplit diagnostics

I don't advocate merging this for the hotfix release (to fix #1779) but this PR can be used to diagnose the real issue and should be merged ASAP afterward.

~I still need to add tests for `last()` and `element()` though.~ Done.
2016-11-16 01:06:37 +00:00
Sean Bowe 3e2e8b5b42 Add test that `last` and `element` will throw exception when the tree is blank. 2016-11-15 12:17:19 -07:00
Sean Bowe d92bea9888 Add tests for witness `element` and tree `last` methods. Strengthen testing by inserting a different commitment into the tree at each step. 2016-11-14 10:13:06 -07:00
Simon 38276c6ba2 Add GenIdentity, an identity function for MappedShuffle.
We use this function in z_sendmany as part of the fix for #1779.
2016-11-05 14:17:19 -07:00
Sean Bowe 5f0a73ce11 Improve accuracy of constraint system violation diagnostics. 2016-11-05 11:27:23 -06:00
Sean Bowe b55744e1ad Regression test for constraint system violation. 2016-11-05 11:15:16 -06:00
Jack Grigg d873bd1d58
Revert "Initialise walletdb system in a temp dir for all gtests"
This reverts commit 74372eaa4c.
2016-11-03 18:04:28 -05:00
Jack Grigg 74372eaa4c
Initialise walletdb system in a temp dir for all gtests 2016-11-03 15:42:44 -05:00
zkbot 51a5737950 Auto merge of #1754 - str4d:1753-genesis-block-coinbase-height-exception, r=str4d
Adjust consensus rule to accept genesis block without height in coinbase

Closes #1753
2016-11-02 18:15:39 +00:00
Jack Grigg 548bbd95f0
Adjust consensus rule to accept genesis block without height in coinbase
Closes #1753
2016-11-01 19:58:56 -05:00
Sean Bowe c4643bd949 Throw more descriptive exceptions when the constraint system is violated. 2016-11-01 14:52:03 -06:00
Daira Hopwood cb1246194e Update the error message string for tx version too low. ref #1600
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-10-22 13:26:44 +01:00
Jack Grigg 80f4cdcf8f
Reject block versions lower than 4
Closes #1556
2016-10-22 00:43:26 -05:00
Jack Grigg 7ac924cdb7
Disallow v0 transactions as a consensus rule
Closes #1557
2016-10-22 00:40:50 -05:00
Jack Grigg 3774c944f8
Refactor test code to better test JSDescription::Randomized() 2016-10-18 12:44:56 -05:00
Jack Grigg 0382417fee
Implement MappedShuffle for tracking the permutation of an array 2016-10-18 00:20:47 -05:00
zkbot 3fceaca3a1 Auto merge of #1506 - bitcartel:master_1478_fix_testnet3_test_issue, r=bitcartel
Stop some wallet tests creating ~/.zcash/testnet3 folder by setting -datadir environment

Closes #1478
2016-10-14 17:03:11 -04:00
Simon 32bf097f90 Fixes #1478 by ensuring wallet tests have the -datadir environment set appropriately. 2016-10-10 20:23:24 -07:00
Sean Bowe 74f15a73a1 Make 100KB transaction size limit a consensus rule, rather than a standard rule. 2016-10-08 00:00:23 -06:00
Jack Grigg 9cf182d451 Update address in Founders' Reward gtest 2016-10-04 11:55:40 -07:00
zkbot d9da9d69ff Auto merge of #1398 - bitcartel:master_fr48, r=bitcartel
Add multiple founders' reward addresses

./zcash-gtest --gtest_filter="founders_reward_test.*"

Closes #1405.
2016-10-01 17:12:33 -04:00
Simon 6c54e9fc0b Update testnet founders reward addresses 2016-09-30 14:42:47 -07:00
Simon 88fd810150 Update founders reward test to output path of temporary wallet.dat file which contains keys which can be used for testing founders reward addresses. 2016-09-30 14:42:47 -07:00
Simon 1a21a25e62 Refactor to add test to verify number of rewards each mainnet address will receive 2016-09-30 14:42:47 -07:00
Simon 241867b115 Founders reward: Refactor test and formatting per review. 2016-09-30 14:42:47 -07:00
Simon 3b30d8361a Founders reward: changed index computation, added new test and some refactoring. 2016-09-30 14:42:47 -07:00
Simon db0f931570 Add founders reward to ChainParams.
Fix bug where subsidy slow shift was ignored.
2016-09-30 14:42:47 -07:00
zkbot d90ed0df93 Auto merge of #1433 - str4d:gtest-expected-failures, r=str4d
Add a make command for checking expected failures

With this merged, we can add gtests prefixed with `DISABLED_`, and then configure Buildbot to run those tests but not require they pass in order to merge.
2016-09-30 17:12:26 -04:00
Simon 73699ceaf6 Add support for spending keys to the encrypted wallet. 2016-09-29 20:17:30 -07:00
Jack Grigg ad041fceec Cache note decryptors in encrypted keystore 2016-09-29 11:34:59 +13:00
Jack Grigg 3bbf2c1422 Test that invalid keys fail to unlock the keystore 2016-09-28 12:52:53 +13:00
Jack Grigg e9006272c2 Add a make command for checking expected failures 2016-09-23 12:32:59 +12:00
Jack Grigg 6ae516f10b Check we haven't trashed the first key entry with the second 2016-09-13 14:21:49 +12:00
Jack Grigg 16d140f4a2 Add support for encrypting spending keys 2016-09-13 14:21:49 +12:00
zkbot 2271d3feda Auto merge of #1338 - str4d:147-tweak-difficulty-adjustment-algorithm, r=ebfull
Tweaks to difficulty adjustment algorithm

This PR changes the difficulty algorithm to adjust from the average difficulty over the
block window instead of from the last difficulty. It also removes the special rules for the
testnet, which are incompatible with difficulty averaging.

Closes #147 again.
2016-09-08 02:21:13 +00:00
Jack Grigg 622ced8a74 Adjust test to account for integer division precision loss 2016-09-08 12:46:00 +12:00
Jack Grigg 4b37cfd5b8 Remove unnecessary method 2016-09-08 12:22:08 +12:00
Jack Grigg aea79ec053 Adjust test to avoid spurious failures
Previously, if the two random numbers happened to be equal, the block time
would not be updated, and subsequent checks would fail.
2016-09-08 11:34:50 +12:00
Simon 33264f5b46 Remove GetTxid() from CTransaction and update test_txid 2016-09-07 15:12:09 -07:00
Simon 6c79b9a12a Update txid gtest to verify #1144 has been removed: GetTxid() and
GetHash() return the same result.
2016-09-07 15:12:09 -07:00
zkbot 02932fc9cc Auto merge of #1341 - ebfull:fix-checktransaction-bug, r=ebfull
Fix CheckTransaction bugs.

Closes #1319.

Does not address the name of `vpub_old` or `vpub_new`.
2016-09-07 20:22:13 +00:00
Jack Grigg 5fbb839f53 Add test of difficulty averaging 2016-09-06 23:01:58 +12:00
Sean Bowe d7eeb7455b Fix CheckTransaction bugs. 2016-09-05 12:18:43 -06:00
Sean Bowe f6b6c9bed8 Update libsnark again. 2016-09-05 12:00:50 -06:00
Jack Grigg 333ea3c426 Remove testnet-only difficulty rules
The min-difficulty blocks are incompatible with difficulty averaging.

Network difficulty is also now defined as the difficulty the network is
currently working to solve, rather than the last non-min-difficulty block
difficulty.
2016-09-05 23:13:25 +12:00
zkbot 2640989d9a Auto merge of #1308 - str4d:1181-getmininginfo-testnet-difficulty-rules, r=ebfull
Separate concepts of block difficulty and network difficulty in RPC

"Block difficulty" is the difficulty listed in a block's header, which in the
testnet can sometimes be min-difficulty (if time-since-last-block is too large).

"Network difficulty" is the difficulty that the network was trying to satisfy
at a particular block height. In mainnet this is always equal to the difficulty
of the solved block for that height, but in testnet the network difficulty is
derived from the last non-min-difficulty block difficulty.

This commit fixes the RPC APIs that are intended to show network difficulty, so
that on testnet they don't sometimes drop to 1.0, confusing users.

Closes #1181
2016-09-01 18:12:46 +00:00
zkbot a723794f81 Auto merge of #1233 - str4d:1199-note-tracking, r=str4d
Add Note tracking

This PR extends the existing transaction tracking in the wallet to track spendable Notes.

Closes #1199
2016-09-01 08:17:07 +00:00
Jack Grigg 00939d09ba Add test comparing GetDifficulty() with GetNetworkDifficulty() 2016-09-01 16:36:18 +12:00
Jack Grigg 73db0c12b9 Increase coverage of GetNoteDecryptor() 2016-09-01 14:44:01 +12:00
Jack Grigg be86b6c332 Add test for GetNoteDecryptor() 2016-08-31 18:57:32 +12:00
zkbot 835588a629 Auto merge of #1314 - str4d:fix-getblock-solution-output, r=ebfull
Output Equihash solution in RPC results as a hex string

When the Equihash solution was changed to a compact form in #1175, the block header changed from storing a vector of indices to a vector of chars. `blockToJSON()` was not updated, which meant that RPC calls like `getblock` returned the solution as a list of 1344 integers.

This PR changes `blockToJSON()` to output the Equihash solution as a hex string, identical to how it appears in the block header.
2016-08-30 18:40:19 +00:00
Jack Grigg 3e3da44c71 Test solution output of blockToJSON() 2016-08-30 14:42:49 +12:00
Simon df3af446e7 Fixes #1122 where json_spirit could stack overflow because there
was no maximum limit set on the number of nested compound elements.
2016-08-26 23:35:45 -07:00
Simon 4b2e557181 Fix comments. 2016-08-24 11:19:34 -07:00
Simon 4cea36bef3 Add gtest to cover new methods in:
CWallet
- GenerateNewZKey()
- AddZKey()
- LoadZKey()
- LoadZKeyMetadata()
CWalletDB
- WriteZKey()
2016-08-24 11:19:33 -07:00
Daira Hopwood c6a7e897bc Add mostly-static checks on consistency of Equihash parameters, MAX_HEADERS_RESULTS, and MAX_PROTOCOL_MESSAGE_LENGTH.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-08-24 06:13:06 +01:00
zkbot cd9d373987 Auto merge of #1260 - str4d:1175-byte-array-manipulation, r=ebfull
Update Equihash implementation to match the Zcash spec

Closes #1175
2016-08-24 03:01:13 +00:00
Jack Grigg 90b740fd3b Test conversion between solution indices and minimal representation 2016-08-24 13:42:52 +12:00
Sean Bowe ae6b333c75 Perform curve parameter initialization at start of gtest suite. 2016-08-22 15:47:00 -06:00
Sean Bowe f0dab51cf3 Implement zkSNARK compression. 2016-08-22 00:36:12 -06:00
zkbot 365845216b Auto merge of #1268 - ThisIsNotOfficialCodeItsJustForks:t1130-upgrade-libsodium, r=ebfull
Upgrade libsodium for AVX2-detection bugfix.

Upgrades libsodium to bring in an AVX2-detection bugfix (to help with #1130).
2016-08-22 02:34:30 +00:00
Jack Grigg 6e629886e5 Add another test case based on example in the spec 2016-08-21 05:57:46 +12:00
Taylor Hornby 2902ac7ce8 Use libsodium's s < L check, instead checking that libsodium checks that. 2016-08-18 16:38:20 -06:00
zkbot 28a30f7801 Auto merge of #1254 - ebfull:tx-structure-changes, r=bitcartel
Change memo field size and relocate `ciphertexts` field of JoinSplit description

Closes #1190
Closes #1187
2016-08-18 16:49:47 +00:00
zkbot 3d28c86c8e Auto merge of #1205 - str4d:1199-key-management, r=str4d
Add support for spending keys to the basic key store

Prerequisite for #1197 and #1199.
2016-08-18 00:27:09 +00:00
Jack Grigg a4f4fa8fe9 ASSERT -> EXPECT in test to get more info per test run about future regressions 2016-08-18 12:25:01 +12:00
Jack Grigg 04dfc3c569 Rework test to check for failure to return a spending key 2016-08-18 12:22:30 +12:00
Jack Grigg 5be6abbf84 Store the Equihash solution in minimal representation in the block header
The genesis blocks and miner tests have been regenerated, because changing the
block header serialisation format changes the block hash, and thus validity.

The Equihash solutions have been removed from the bloom test inputs for
simplicity (block validity is not checked there; only a valid serialisation is
necessary).
2016-08-16 16:02:39 +12:00
Jack Grigg 20abe2083c Extend byte array expansion and compression methods with optional padding 2016-08-16 11:02:04 +12:00
Jack Grigg caa0348f04 Update Equihash hash generation to match the Zcash spec
Changes:

- floor(512/n)*n/8 bytes of BLAKE2b output is split between floor(512/n)
  adjacent indices, instead of using one hash call per index.

- Parameters with n/(k+1) mod 8 != 0 will expand the BLAKE2b output to byte
  boundaries for colliding, instead of using a longer output and clearing bits.

- The genesis blocks have been regenerated.

- The test vectors have been regenerated.

- The Equihash inputs for the cancellation tests were modified to ensure that
  valid solutions were available to exercise the full solver.
2016-08-16 11:02:04 +12:00
Jack Grigg 881ffbfc87 Add methods for byte array expansion and compression
These methods convert between:

- A byte array of length NL/8, and
- An array of N blocks of ceil(L/8) bytes.
2016-08-16 11:02:00 +12:00
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