Commit Graph

171 Commits

Author SHA1 Message Date
Larry Ruane ffb8e6747b access array element using at() 2019-10-12 19:06:51 -06:00
Larry Ruane 7ec8c5d309 precompute empty merkle roots 2019-10-12 18:03:36 -06:00
Homu 961c0d58ec Auto merge of #4060 - str4d:remove-libsnark, r=daira
Remove libsnark

Closes #167. Closes #416. Closes #418. Closes #437.
Closes #521. Closes #743. Closes #750. Closes #894.
Closes #903. Closes #1125. Closes #1136. Closes #1240.
Closes #1264. Closes #1516. Closes #1517. Closes #1651.
Closes #2064. Closes #2158. Closes #3478. Closes #3652.
Closes #3744.
2019-09-26 11:21:40 -07:00
Jack Grigg c1fbf8ab5d
Ignore exceptions when deserializing note plaintexts 2019-09-19 22:29:24 +01:00
Jack Grigg fe3cb8ec93
Remove makeGrothProof argument from JoinSplit::prove 2019-09-16 13:10:54 +01:00
Jack Grigg 8a638d5fd8
Remove pre-Sapling Sprout circuit 2019-08-22 15:42:48 +01:00
Jack Grigg 5f84491d82
Remove libsnark code for pre-Sapling Sprout proofs 2019-08-22 15:42:47 +01:00
Jack Grigg 93dae1db7d
Revert "Allow user to ask server to save the Sprout R1CS out during startup."
This reverts commit 685c0ab07f.
2019-08-22 15:42:46 +01:00
Jack Grigg 1e812cd694
Remove ability to create non-Groth16 Sprout JSDescriptions 2019-08-22 15:42:41 +01:00
Daira Hopwood bc909a7a7f Replace http with https: in links to the MIT license.
Also change MIT/X11 to just MIT, since no distinction was intended.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2019-07-18 15:26:01 +01:00
Sean Bowe 685c0ab07f Allow user to ask server to save the Sprout R1CS out during startup. 2018-11-17 17:10:58 -07:00
Jack Grigg 1b79de781c
Store ExtFVK with encrypted Sapling spending key instead of FVK
This ensures that even when the wallet is encrypted, we can derive the default
Sapling payment address for our spending keys.
2018-10-05 23:13:32 +01:00
Jack Grigg bb4b6982e3
Generate an ovk to encrypt outCiphertext for t-addr senders
Closes #3506.
2018-09-19 00:51:30 +01:00
Jack Grigg 70b4ad2dcd
wallet: Switch from SaplingSpendingKey to SaplingExtendedSpendingKey
The wallet now only stores Sapling extended spending keys, and thus can
only be used with keys generated from an HDSeed via ZIP 32.

Note that not all Sapling keys in the wallet will correspond to the
wallet's HDSeed, as a standalone Sapling xsk can be imported via
z_importkey. However, it must have been generated from a seed itself,
and thus is more likely to be backed up elsewhere.
2018-09-03 10:45:37 +01:00
Jack Grigg 7614198f9d
ZIP 32 Sapling structs 2018-09-03 10:27:52 +01:00
Homu 12c1156f31 Auto merge of #3172 - str4d:mingw32, r=str4d
Windows cross-compile support

Usage on Debian / Ubuntu:

> $ sudo apt install mingw-w64
> $ sudo update-alternatives --config x86_64-w64-mingw32-gcc
> (configure to use POSIX variant)
> $ sudo update-alternatives --config x86_64-w64-mingw32-g++
> (configure to use POSIX variant)
> $ HOST=x86_64-w64-mingw32 ./zcutil/build.sh

Closes #489.
2018-08-30 14:51:24 -07:00
David Mercer 32d3a3352e
libsnark: convert long long and unsigned long to C++11 fixed-width types
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2018-08-17 18:53:59 +01:00
Sean Bowe 69c4391b0f Check commitment validity within the decryption API for Sapling note plaintexts. 2018-08-08 12:03:09 -07:00
Jack Grigg 74f5b010df
Rename Serialized*Size -> SerializedSprout*Size 2018-08-03 01:57:40 +01:00
Jay Graber 55f2889396
Add Sapling have/get sk crypter overrides 2018-08-03 00:23:08 +01:00
Eirik Ogilvie-Wigley 7d379f18c5 Rename test objects to include sprout or sapling 2018-08-01 10:52:58 -06:00
Eirik Ogilvie-Wigley 8ea8ef9850 Rename Witnesses to include sprout or sapling 2018-08-01 10:41:36 -06:00
Eirik Ogilvie-Wigley 4fc309f0f5 Rename Merkle Trees to include sprout or sapling 2018-08-01 10:31:09 -06:00
Jack Grigg 70a7535ae8
Expose note position in IncrementalMerkleWitness 2018-07-24 14:54:07 +02:00
Jack Grigg 66a519f55d
Alter SaplingNote::nullifier() to take a SaplingFullViewingKey
This means the API will work if you only have a SaplingExtendedSpendingKey,
as will be the case with ZIP 32.
2018-07-24 14:54:01 +02:00
Homu a7a62b724b Auto merge of #3391 - bitcartel:3061_sapling_note_encryption, r=ebfull
Sapling note plaintext (encryption and decryption)

Add encryption and decryption of SaplingNotePlaintext and SaplingOutgoingPlaintext classes.

This is part of #3061 to add Sapling note functionality.
2018-07-24 03:27:28 -07:00
Simon e739ca2ef2 Rename AttemptSaplingEncDecryptionUsingFullViewingKey and use function overloading. 2018-07-23 10:48:26 -07:00
Simon 7b913c3e5e Implement Sapling note decryption using full viewing key. 2018-07-20 16:31:48 -07:00
Simon 687bd96cbd Minor update to address nits in review. 2018-07-17 14:26:38 -07:00
Sean Bowe f23e783600 Decryption and tests of note/outgoing encryption. 2018-07-16 18:34:14 -06:00
Homu eea0e2c924 Auto merge of #3390 - arcalinea:3319_discard_sk_if_invalid_ivk, r=str4d
Discard sk if ivk == 0

Addresses #3319
2018-07-13 03:16:21 -07:00
Jay Graber db9f669c15 Discard sk if ivk == 0 2018-07-12 15:05:19 -07:00
Simon 34bf166e5f Add encryption of SaplingNotePlaintext and SaplingOutgoingPlaintext classes.
This is part of #3061 to add Sapling note functionality.
2018-07-11 22:03:04 -07:00
Homu d86f60f382 Auto merge of #3324 - ebfull:sapling-note-encryption, r=ebfull
Sapling note encryption implementation

Closes #3055

Implemented along with @gtank and @Eirik0

DH key exchange was implemented in https://github.com/zcash/librustzcash/pull/18
2018-07-11 14:51:57 -07:00
Sean Bowe 7478876271 Minor edits 2018-07-11 15:48:41 -06:00
Jay Graber 2173767365 Add crypted keystore sapling add key 2018-07-05 15:00:00 -07:00
Jay Graber 8e91ebf76c Change default_address to return SaplingPaymentAddr and not boost::optional 2018-07-05 14:52:51 -07:00
Homu 2ebde5860e Auto merge of #3326 - str4d:3058-sapling-addresses, r=str4d
Sapling address encodings

This PR enables Sapling keys and addresses to be passed in anywhere Sprout keys
and addresses are used. Doing so will cause crashes until those places are updated
with Sapling support.

Includes code cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#11167
  - Only the `ConvertBits()` function.
- bitcoin/bitcoin#11630

Closes #3058.
2018-06-19 05:12:50 -07:00
Sean Bowe 4e1f2daa0d Add get_esk() function to Sapling note encryption. 2018-06-18 13:14:43 -06:00
Sean Bowe c03e22612d Prevent nonce reuse in Sapling note encryption API. 2018-06-14 12:21:28 -06:00
Sean Bowe 9e1c2c4049 Implementation of Sapling in-band secret distribution. 2018-06-14 11:58:45 -06:00
Homu 4f18c693c3 Auto merge of #3272 - bitcartel:3061_sapling_add_notes, r=bitcartel
Add SaplingNote class

Part of #3061, adding SaplingNote class.
2018-06-12 16:58:38 -07:00
Simon 268e5dfa50 Return optional for Sapling commitments and nullifiers.
Unlike Sprout, they are not always computable in Sapling.
2018-06-12 14:40:17 -07:00
Simon d17f8d1cc7 Refactor and replace factory method random() with constructor. 2018-06-12 14:37:15 -07:00
Simon 36e2e7cc32 Add SaplingNote class and test_sapling_note unit test. 2018-06-12 14:37:05 -07:00
Ariel Gabizon e1a3461cc2 Improve/Fix variable names
ZCProof was too general. pubKeyHash was actually the JoinSplit pubkey
itself.
2018-06-09 20:27:35 -07:00
Jack Grigg bec3e62bc1
Implement encoding and decoding of Sapling keys and addresses 2018-06-07 17:28:50 +12:00
Homu 80338c07e5 Auto merge of #3237 - str4d:std-array, r=str4d
Replace boost::array with std::array
2018-06-06 19:36:57 -07:00
Jay Graber 87c9994cb2 Make diversifier functions return option 2018-06-04 07:47:46 -07:00
Jay Graber 0da9aac63e s/SaplingInViewingKey/SaplingIncomingViewingKey 2018-06-04 04:59:07 -07:00