Commit Graph

246 Commits

Author SHA1 Message Date
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
therealyingtong 44f46e50ce
Add <P: consensus::Parameters> type parameter to Builder struct 2020-08-06 11:43:07 +08:00
therealyingtong 88072d64ec
Remove network cfg from zcash_client_backend and zcash_primitives 2020-08-06 11:35:05 +08:00
therealyingtong c8fcdeb50b
Minor changes in note_encryption.rs 2020-08-05 15:45:18 +08:00
therealyingtong 2ed9b6f881
Refactor contextual random rseed generation into util method in zcash_primitives 2020-08-05 15:21:42 +08:00
therealyingtong a3ae1b273d
Switch plaintext version on height for dummy outputs in Builder 2020-08-05 14:27:36 +08:00
therealyingtong a25348dfba
Revert passing Parameters to methods 2020-08-05 12:47:29 +08:00
therealyingtong 0a47a9dbea
Pass rseed to Prover 2020-08-04 16:40:53 +08:00
therealyingtong b34e8b903c
Add invalid version byte tests for ZIP212 2020-08-03 13:51:45 +08:00
therealyingtong eba542c95f
Add activation heights as consts in consensus::Parameters 2020-08-03 13:40:39 +08:00
therealyingtong b1ddd556af
Check derived esk against claimed epk when decrypting note 2020-07-31 22:40:52 +08:00
therealyingtong 895e251793
Fix tests 2020-07-31 22:40:48 +08:00
therealyingtong 6904c8f933
Implement plaintext_version_is_valid() 2020-07-31 22:28:51 +08:00
therealyingtong eda00ec7ad
Pass esk to SaplingNoteEncryption::new and add generate_or_derive_esk() 2020-07-31 22:28:50 +08:00
therealyingtong 65504d9ca7
Add enum Rseed<E::Fs> to Note struct 2020-07-31 22:28:40 +08:00
therealyingtong b537f0f712
Pass height to methods which encrypt or decrypt Sapling outputs 2020-07-31 12:39:39 +08:00
therealyingtong 71d31abad6
Set activation heights for Canopy 2020-07-30 12:52:02 +08:00
str4d f55f094ef6
Merge pull request #248 from str4d/equihash-crate
Move Equihash verifier into equihash crate
2020-07-10 11:57:11 +12:00
Jack Grigg b5bd52e7a1 equihash 0.1.0 2020-07-10 10:25:52 +12:00
str4d d380a8c8d2
Merge pull request #246 from str4d/zcash_client_sqlite
zcash_client_sqlite crate
2020-07-10 10:22:37 +12:00
Jack Grigg 5b2c71e112 Move Equihash verification APIs into equihash crate 2020-06-26 13:01:04 +12:00
Jack Grigg 34725df086 zcash_client_sqlite::transact::create_to_address() 2020-06-25 18:54:41 +12:00
therealyingtong a4b010e003 Placeholders for Canopy network upgrade 2020-06-04 15:44:15 +08:00
Jack Grigg 3779c12e31 Set activation heights for Heartwood network upgrade 2020-06-04 15:33:07 +12:00
Aditya Kulkarni 4b1d8e5226 Add methods to get OutPoint n, hash 2020-05-22 18:02:44 -07:00
Jack Grigg 4edff96321 Fix various lints 2020-05-22 18:52:35 +12:00
Jack Grigg d7d49285d8 Remove explicit std::marker from Sized bound
Sized is always part of the prelude, and binding on std causes
compilation issues for no-std crates.
2020-05-15 00:20:32 +12:00
Jack Grigg c597db59a6 ff: Rename PrimeField::into_repr -> PrimeField::to_repr 2020-05-02 18:55:13 +12:00
Jack Grigg 15e229509a ff: Move pow_vartime back into Field trait
The only places we don't use constant u64 limbs, we use PrimeField::char
instead (except in a single test where we use a field element).
2020-05-02 18:54:02 +12:00
Jack Grigg fb31d09218 ff: Remove Ord bound from PrimeField
ff_derive still implements Ord and PartialOrd for the fields it
implements, because pairing::bls12_381 internally assumes that those are
implemented. Once we delete that implementation, we will remove the Ord
and PartialOrd implementations from ff_derive.
2020-05-02 18:54:02 +12:00
Jack Grigg 38f87c2e73 ff: Add PrimeField::ReprEndianness associated type
This enables generic code to reliably operate on the bits of an encoded
field element, by converting them to and from a known (little)
endianness.

The BitAnd and Shr bounds on PrimeField are now removed, as users can
perform these operations themselves as needed.
2020-05-02 18:54:02 +12:00
Jack Grigg 55568b4d6e ff: Remove frobenius_map from Field trait
It is only used internally in the bls12_381 crate, and field extensions
aren't exposed anywhere in the Zcash stack.
2020-05-02 16:07:48 +12:00
Jack Grigg 1761ebfb35 ff: Remove SqrtField trait
The sqrt() function is now part of the Field trait. ff_derive returns an
error on fields for which it does not support generating a square root
function.

Note that Fq6 and Fq12 in pairing::bls12_381 leave the function
unimplemented. They will be dropped once the migration to the bls12_381
crate is complete. The equivalent structs in that crate are not exposed.
2020-05-02 16:07:48 +12:00
str4d b02cf3b467
Merge pull request #223 from str4d/remove-primefieldrepr
Remove ff::PrimeFieldRepr
2020-05-01 08:59:41 +12:00
Jack Grigg 49f119fb03 ff: Remove PrimeFieldRepr trait
The ff::PrimeField::Repr associated type now has the minimal necessary
bounds, which can be satisfied by a newtype around a byte array.
2020-04-23 18:15:14 +12:00