Jack Grigg
bc9ca20d56
Make use of assignment operators
2020-10-30 13:26:36 +00:00
Jack Grigg
890648df4d
Use !x.is_empty() instead of x.len() > 0
2020-10-30 13:25:08 +00:00
Jack Grigg
0bbcd8c408
Remove unnecessary imports
2020-10-30 13:22:46 +00:00
Aditya Kulkarni
70ecd6b2d8
Export notesize constants
2020-10-26 11:31:22 -07:00
Jack Grigg
d657ff906e
zcash_primitives: Small simplification to Script::address
2020-10-18 13:17:16 +01:00
Kris Nuttycombe
b1c3f9d3f0
ZIP 321 Reference Implementation ( #294 )
...
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2020-10-15 14:03:40 +01:00
Kris Nuttycombe
eeb0c2b08a
Update comment in zcash_primitives/src/transaction/builder.rs
2020-10-13 14:28:54 -06:00
Kris Nuttycombe
536c77bea7
Fix formatting.
2020-10-13 07:12:33 -06:00
Kris Nuttycombe
cc121ede8e
Document `TzeIn` serialization.
2020-10-09 16:37:00 -06:00
Kris Nuttycombe
39ab6e5b95
Apply suggestions from code review
...
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-10-09 16:19:44 -06:00
Kris Nuttycombe
26aa23988c
Replace domain separator with a 1-byte tag.
2020-09-30 10:22:51 -06:00
Kris Nuttycombe
03b4e56a44
Formatting fix.
2020-09-23 17:14:35 -06:00
Kris Nuttycombe
b6cd096c10
Generate plausible scripts for transaction proptests.
...
Co-authored-by: str4d <thestr4d@gmail.com>
2020-09-23 14:48:10 -06:00
Kris Nuttycombe
9963fb9e57
Use CompactSize & Vector::write for tze sighash construction.
2020-09-23 14:37:48 -06:00
Kris Nuttycombe
995d063992
Documentation fixes from code review.
...
Co-authored-by: str4d <thestr4d@gmail.com>
2020-09-23 14:16:29 -06:00
Kris Nuttycombe
6a536aa88a
Use more informative type names in Extension trait.
2020-09-23 13:35:14 -06:00
Kris Nuttycombe
36c28341b3
Additional future -> zfuture renaming.
2020-09-23 13:11:47 -06:00
Kris Nuttycombe
99eb5b9336
Rename `Future -> ZFuture`
...
Proactively distinguish against future use of the
futures crate for source greppability.
2020-09-22 10:17:58 -06:00
Kris Nuttycombe
a0a36eddfd
Merge remote-tracking branch 'upstream/master' into zip-tzes
...
Fix benchmark build issues.
2020-09-21 16:43:33 -06:00
Kris Nuttycombe
ab2d5bf603
Merge remote-tracking branch 'upstream/master' into zip-tzes
2020-09-21 10:08:05 -06:00
str4d
e0587e752b
Merge pull request #290 from str4d/273-remove-decryption-epk-subgroup-check
...
Take epk as a jubjub::ExtendedPoint for note decryption
2020-09-22 03:05:35 +12:00
Kris Nuttycombe
924ee09bc4
Add documentation to primary `Extension` trait
2020-09-18 11:21:44 -06:00
Kris Nuttycombe
cfb6850d7c
Rustfmt
2020-09-18 10:52:58 -06:00
Kris Nuttycombe
80e1d35ea6
Apply additional suggestions from code review.
2020-09-18 10:40:30 -06:00
Kris Nuttycombe
90d8980162
Apply suggestions from code review
...
Co-authored-by: str4d <thestr4d@gmail.com>
2020-09-18 10:39:37 -06:00
Kris Nuttycombe
d232133216
Add constants to support static resolution of network parameters.
2020-09-17 12:58:23 -06:00
Kris Nuttycombe
1ad9294933
Remove static determination of network state.
...
In the interest of making the library usable for both
testnet and mainnet without recompilation, static resolution
of network parameters has been replaced with a parameter passed
to the relevant functions. This also moves addres prefix constants
into the network parameters.
2020-09-17 10:34:42 -06:00
Kris Nuttycombe
efaba87681
Add newtype for block height.
2020-09-17 10:26:41 -06:00
Kris Nuttycombe
c35c501734
Add comment on FUTURE_TX_VERSION/GROUP_ID`
2020-09-10 14:52:47 -06:00
Kris Nuttycombe
208208238d
Add property test for round-trip serialization of TZE-bearing transactions.
2020-09-10 14:52:47 -06:00
Kris Nuttycombe
a5d5f87b48
Bind TZE inputs and outputs in signature.
2020-09-10 14:52:47 -06:00
Kris Nuttycombe
eb4a2d5032
Add domain separator to transparent signatures.
...
Once TZEs are active, we would like to ensure that collisions
between TZE input signatures and transparent input signatures
cannot occur, so we add a domain separator to both.
This also ensures that if TZE inputs are presented for signature
without using the `Future` sighash version, that the signing
code will report an error.
2020-09-10 14:52:47 -06:00
Kris Nuttycombe
5a432b5e2b
Ensure that prevout, extension_id & mode data can be signed in builder.
2020-09-10 14:52:47 -06:00
Kris Nuttycombe
1a8168e1c9
Document transaction builder methods.
2020-09-10 14:52:47 -06:00
Kris Nuttycombe
671caa8b84
Remove unused Epoch trait.
2020-09-10 14:52:47 -06:00
Kris Nuttycombe
23634d4cd0
Document ExtensionTxBuilder methods
2020-09-10 14:52:47 -06:00
Kris Nuttycombe
9d2f388b3b
Apply idiomatic rustlang suggestions from code review
...
Co-authored-by: str4d <thestr4d@gmail.com>
2020-09-10 14:52:47 -06:00
Kris Nuttycombe
9ef15b536c
Update method documentation in zcash_primitives/src/extensions/transparent.rs
...
Co-authored-by: str4d <thestr4d@gmail.com>
2020-09-10 14:52:47 -06:00
Kris Nuttycombe
b15e49ef47
Documentation update to zcash_primitives/src/extensions/transparent.rs
...
Co-authored-by: str4d <thestr4d@gmail.com>
2020-09-10 14:52:47 -06:00
Kris Nuttycombe
af931d524a
Demo TZE fixes in response to PR comments.
2020-09-10 14:52:47 -06:00
Kris Nuttycombe
aed2759e1e
Use NetworkUpgrade for TZE epoch determination.
...
This adds a `Future` variant for both BranchId and NetworkUpgrade.
2020-09-10 14:52:47 -06:00
Kris Nuttycombe
81b6f8afd7
Formatter fix.
2020-09-10 14:52:47 -06:00
Kris Nuttycombe
4bf6309c54
Update to non-yanked version of subtle crate.
2020-09-10 14:52:47 -06:00
Kris Nuttycombe
8299f336d3
Add test for tze txn parsing.
2020-09-10 11:58:40 -06:00
Kris Nuttycombe
dc9b007e8e
Add signature hash over TZE data.
2020-09-10 11:58:40 -06:00
Kris Nuttycombe
294aa86195
Change extension_id and mode types to u32
2020-09-10 11:58:40 -06:00
Kris Nuttycombe
4edbd26d7f
Keep transaction details private.
2020-09-10 11:58:40 -06:00
Kris Nuttycombe
fe6bea1fce
Check transparent input for correctness before modifying vin.
2020-09-10 11:58:40 -06:00
Kris Nuttycombe
4a954c7f8f
Add tests for transaction builder support.
2020-09-10 11:58:40 -06:00
Kris Nuttycombe
ca8e24eef5
Add validation to demo transaction builder.
2020-09-10 11:58:40 -06:00
Kris Nuttycombe
659c34a954
Make error a type member of FromPayload trait rather than a type variable.
...
Fix demo test compilation errors.
2020-09-10 11:58:40 -06:00
Jack Grigg
961d251178
Add transaction-builder suport for TZE-bearing transactions.
2020-09-10 11:58:40 -06:00
Jack Grigg
bf7f95b0e9
TZE consensus context and program sets
...
Co-authored-by: Kris Nuttycombe <kris.nuttycombe@gmail.com>
2020-09-10 11:58:40 -06:00
Jack Grigg
ce9a695ded
Demo TZE parsing and consensus logic
2020-09-10 11:58:40 -06:00
Jack Grigg
b3332db3e9
Add TZEs to transaction format
2020-09-10 11:58:40 -06:00
Jack Grigg
192db29a25
Take epk as a jubjub::ExtendedPoint for note decryption
...
We don't need to check if epk is in the prime-order subgroup before we
trial-decrypt, which saves a third of the cost of trial-decrypting
outputs that are not ours.
2020-09-10 00:39:21 +01:00
Jack Grigg
0b9063e479
zcash_primitives: Add benchmark for Sapling note decryption
2020-09-10 00:21:05 +01:00
Sean Bowe
d4cba74402
Version bump 0.4.0 for crates
...
Bumps zcash_proofs, zcash_primitives, zcash_client_backend to 0.4.0
Also bumps zcash_client_sqlite to 0.2.0
2020-09-09 14:41:19 -06:00
ebfull
c7e9523dce
Merge pull request #284 from str4d/259-ovk-none
...
zcash_primitives: Support ovk = ⊥ in note encryption
2020-09-09 14:32:57 -06:00
Jack Grigg
59e26a0c0f
bls12_381 0.3.1 and jubjub 0.5.1
2020-09-09 16:51:53 +01:00
Jack Grigg
6a62993714
secp256k1 0.19
2020-09-09 00:38:54 +01:00
Jack Grigg
96bd59b942
Migrate to ff 0.8 and bellman 0.8
...
bellman 0.8 includes fixes for several performance regressions.
MSRV is now 1.44.0, matching the ff crate.
2020-09-09 00:27:51 +01:00
Jack Grigg
40e135783c
zcash_primitives: Support ovk = ⊥ in note encryption
...
Closes zcash/librustzcash#259 .
2020-08-28 21:17:16 +01:00
Jack Grigg
72817b0edc
zcash_primitives: Add OutgoingCipherKey struct
2020-08-28 16:17:15 +01:00
Jack Grigg
3f06d92eec
Depend on published versions of subtree crates
2020-08-27 23:25:20 +01:00
Jack Grigg
e25a7dacdf
zcash_primitives 0.3.0
2020-08-23 16:23:53 +01:00
Jack Grigg
d112add8a3
jubjub 0.4.0
2020-08-23 16:23:53 +01:00
Jack Grigg
5f99c52143
bls12_381 0.2.0
2020-08-23 16:23:53 +01:00
Jack Grigg
bdb42bcbc8
pairing 0.17.0
2020-08-23 15:31:09 +01:00
Jack Grigg
ee3e8fbfbb
group 0.7.0
2020-08-23 15:31:09 +01:00
Jack Grigg
55fa366730
ff 0.7.0
2020-08-23 15:31:09 +01:00
Jack Grigg
a3cb89dff9
zcash_primitives: Add feature flags to docs.rs documentation
2020-08-23 06:56:03 +01:00
Daira Hopwood
cfed47c176
Rename ValueCommitment.cm() to .commitment() (because it's confusing to have cm referring to both note and value commitments).
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-08-22 01:28:13 +01:00
Daira Hopwood
20c5096793
Fix remaining cases of cm -> cmu.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-08-22 01:28:13 +01:00
Daira Hopwood
ee6c21f95b
Scripted diff:
...
```
find . -not -path '*/.git/*' -a -type f -exec sed -i -e 's/hash_x/hash_u/g' {} \;
find . -not -path '*/.git/*' -a -type f -exec sed -i -e 's/hash_y/hash_v/g' {} \;
```
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-08-22 01:28:13 +01:00
Jack Grigg
d15acf8acc
zcash_primitives: Rename Note::cm to Note::cmu
2020-08-21 18:35:04 +01:00
Jack Grigg
7a6223202e
zcash_primitives: Remove redundant TODO
...
The primitives are no longer generic over a curve; we hard-code Jubjub,
so we know that the smallest u-coordinate that is not on the curve is 1.
2020-08-21 18:27:09 +01:00
Jack Grigg
ca5bc6b0ae
zcash_primitives: Fix names of some test vector macros
2020-08-21 18:25:30 +01:00
Jack Grigg
ed3489a111
zcash_primitives: Explicitly type zero-initialised arrays
2020-08-21 18:22:29 +01:00
Jack Grigg
b9a8e1e415
zcash_primitives: Remove Jubjub implementation
...
We now use the jubjub crate for this.
2020-08-19 23:08:19 +01:00
Jack Grigg
fdf06032e3
s/{pairing::bls12_381, zcash_primitives::jubjub}/{bls12_381, jubjub}
...
FINALLY.
2020-08-19 23:08:19 +01:00
Jack Grigg
10c571f2cd
zcash_primitives: Define generator constants using new crates
...
Includes tests to ensure that the new generator constants match the
current zcash_primitives::JUBJUB generators.
2020-08-19 23:08:19 +01:00
Matthew Fors
b86558c63a
Decrypt sapling output description given OCK ( #271 )
...
* decrypt sapling outputs directly with ock
* make prf_ock public
* unit tests for ock sapling output decryption
2020-08-19 06:38:09 +12:00
Jack Grigg
45a7861720
zcash_primitives: fpe 0.3
2020-08-16 11:16:23 +01:00
Jack Grigg
751ddad17d
zcash_primitives: crypto_api_chachapoly 0.4
2020-08-14 17:44:17 +01:00
Jack Grigg
9ced89a1b0
zcash_primitives: secp256k1 0.17
2020-08-14 17:44:17 +01:00
Jack Grigg
bc8a839c61
Migrate to hex 0.4
2020-08-14 17:44:17 +01:00
Jack Grigg
5fe2d6a57c
zcash_primitives: ripemd160 0.9 and sha2 0.9
2020-08-14 17:44:17 +01:00
ying tong
72cc8fc916
Minor refactor of enumeration in tests in note_encryption.rs
...
Co-authored-by: str4d <thestr4d@gmail.com>
2020-08-07 08:46:15 +08:00
ying tong
13f4d0844e
Avoid using unwrap() when calling derive_esk()
...
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-08-07 00:12:07 +08:00
therealyingtong
d54fd09c5f
Add esk check in parse_note_plaintext_without_memo() and try_sapling_output_recovery()
2020-08-06 18:39:49 +08:00
therealyingtong
5480a376df
Extract derive_esk() into separate function
2020-08-06 18:21:27 +08:00
therealyingtong
7cee29bbcc
Use <P: consensus::Parameters> type for Builder impl
2020-08-06 18:12:15 +08:00
ying tong
0f8f1b3f5d
Fix parsing of rseed in parse_note_plaintext_without_memo() and try_sapling_output_recovery()
...
Co-authored-by: str4d <thestr4d@gmail.com>
2020-08-06 18:12:15 +08:00
ying tong
40a908e0a8
Refactor leadbyte_array in note_encryption tests
...
Co-authored-by: str4d <thestr4d@gmail.com>
2020-08-06 18:12:10 +08:00
therealyingtong
8968547981
Document pub enum Rseed<Fs> with link to ZIP 212
2020-08-06 13:13:49 +08:00
therealyingtong
878646855c
Switch on leadbyte instead of tx height when decrypting outputs
2020-08-06 12:57:48 +08:00
therealyingtong
c3d89644e2
Revert SaplingNoteEncryption::new() API to take rng instead of esk
2020-08-06 12:47:35 +08:00
therealyingtong
4f22077cf6
Remove const activation heights from consensus.rs
2020-08-06 12:30:48 +08:00
therealyingtong
9970a8aefd
Hard-code NetworkUpgrade::Canopy in generate_random_rseed
2020-08-06 12:27:20 +08:00