Commit Graph

302 Commits

Author SHA1 Message Date
Jack Grigg b9ce8224b6 Implement structural generator for v5 transaction format (ZIP 225) 2021-05-26 17:46:53 +01:00
Daira Hopwood c056ec5dc0
Merge pull request #29 from zcash-hackworks/orchard-key-components
Orchard key components
2021-05-26 11:05:19 +01:00
therealyingtong cbf2e840b9 Remove bytes() coercion for OrchardNotePlaintext.rseed
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-05-26 14:32:28 +08:00
therealyingtong c182edabd4 Address review comments.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-05-26 14:26:08 +08:00
therealyingtong 406747099a Test decryption using ivk and fvk 2021-05-26 14:10:36 +08:00
therealyingtong 11ad2d4f95 Add orchard_note_encryption.py 2021-05-26 14:10:36 +08:00
therealyingtong 6f395a5750 Add orchard_note.py 2021-05-26 14:10:36 +08:00
therealyingtong 63a1e76fb9 Add orchard_utils.py 2021-05-26 14:10:36 +08:00
therealyingtong e50da335f5 Use randomness in test and address review comments 2021-05-26 13:30:52 +08:00
therealyingtong 646ff15777 Use ff1 for default diversifier 2021-05-26 13:29:59 +08:00
ying tong 12a07b4f61
Merge pull request #28 from zcash-hackworks/orchard-commitments
Add Orchard commitments
2021-05-26 11:38:36 +08:00
Kris Nuttycombe 5e1e5498f7
Merge pull request #31 from zcash-hackworks/f4jumble
Test vector generator for F4Jumble
2021-05-19 09:02:44 -06:00
therealyingtong f1342994dd Case ivk as Scalar in default_pkd() 2021-05-14 11:16:34 +08:00
therealyingtong 04587ac9ba Fix Scalar typecasting
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-05-14 11:16:34 +08:00
therealyingtong d5a8927316 Remove unnecessary to_base()
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-05-14 11:16:34 +08:00
therealyingtong 77f1299d9b Add derive_nullifier() method 2021-05-14 11:16:34 +08:00
Daira Hopwood 8ce3cfb8d9 Add orchard_key_components.py.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-05-14 11:16:34 +08:00
ying tong 99e7184038
Remove whitespace in note_commit and commit_ivk personalisations
Co-authored-by: str4d <jack@z.cash>
2021-05-13 12:57:07 +08:00
str4d 232aaa3474
Update f4jumble.py
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-05-12 13:06:52 +01:00
Jack Grigg bd1eef9c16 Test vector generator for F4Jumble 2021-05-12 08:16:06 +08:00
therealyingtong e0b8fd639a Return base field element from commit_ivk()
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-05-11 20:06:32 +08:00
ying tong fb08eeeb39 Pass rand instead of randbytes
Co-authored-by: str4d <jack@z.cash>
2021-05-09 12:46:09 +08:00
Daira Hopwood af04017407 orchard_pallas.py: add constants for Scalar.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-05-09 12:44:40 +08:00
Daira Hopwood 29c40dc885 orchard_commitments.py and orchard_group_hash.py: type fixes.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-05-09 12:44:40 +08:00
Daira Hopwood 929692ecdc Rename sapling_utils.py to utils.py.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-05-09 12:44:39 +08:00
Daira Hopwood a7a1e5b217 Use rejection sampling to implement `random` for `Fp` and `Scalar`.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-05-09 12:41:18 +08:00
therealyingtong 72cae20b61 Add Orchard commitments
HomomorphicPedersenCommit -> ValueCommit
SinsemillaCommit -> NoteCommit
SinsemillaShortCommit -> CommitIvk
2021-05-09 12:41:18 +08:00
ying tong bd7c367590 Apply suggestions from code review
Co-authored-by: str4d <jack@z.cash>
2021-05-09 12:41:18 +08:00
therealyingtong 43de24d88c Add Orchard generators 2021-05-09 12:41:18 +08:00
str4d 03157edaf2
Merge pull request #27 from zcash-hackworks/poseidon
Poseidon implementation
2021-05-08 19:54:01 +01:00
str4d deee246420
Add numpy dependency to README 2021-05-09 06:53:31 +12:00
str4d cb9348e7a9
Apply suggestions from code review 2021-05-08 19:51:33 +01:00
ying tong bb16eca2c0 Only return first state element from Poseidon hash
Co-authored-by: str4d <jack@z.cash>
2021-05-07 12:59:38 +08:00
therealyingtong 25f5ccd445 Generate Poseidon hash test vectors 2021-05-07 12:58:33 +08:00
therealyingtong 6184981ccd Generate Poseidon perm test vectors 2021-05-07 12:58:33 +08:00
therealyingtong 99feaed0f4 Render array of bytearrays in tv_output 2021-05-07 12:58:33 +08:00
therealyingtong 48fca9ad62 Add Poseidon implementation 2021-05-07 12:58:33 +08:00
ying tong b2c074a8d1
Merge pull request #21 from zcash-hackworks/orchard-merkle-crh
Add Orchard MerkleCRH
2021-05-07 01:38:32 +08:00
Daira Hopwood 5a820ad113 Fix length of layer prefix in orchard_merkle_tree.py.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-05-06 16:14:28 +01:00
therealyingtong c73aabd641 Add Orchard MerkleCRH 2021-04-30 12:20:37 +08:00
str4d 0cc31479cf
Merge pull request #17 from zcash-hackworks/sinsemilla-test-vectors
Add iso-Pallas, SWU hash-to-curve, and Sinsemilla
2021-04-29 02:20:39 +01:00
Daira Hopwood f8008a01fd
Apply suggestions from code review
Comments and a minor refactor for consistency.
2021-04-29 02:07:46 +01:00
Jack Grigg 9cb9e0f9bc Generate random test vectors for MapToCurve, GroupHash, Sinsemilla 2021-04-29 12:59:16 +12:00
Jack Grigg c6cd47a5dd Fix Rand.u8() to return unsigned integers
Existing test vector generators are adjusted to use Rand.i8() so they
generate the same test vectors. We should evaluate these later to
determine whether they should actually use Rand.u8() (and update the
test vectors across the ecosystem).
2021-04-29 12:57:40 +12:00
Jack Grigg 10bdd6c5f8 Split apart MapToCurveSimpleSWU and GroupHash test vectors
The test vector generators in this repository are meant to output data
that can be copy-pasted or piped to a file. Generating multiple sets of
test vectors from a single file interferes with this.
2021-04-29 12:29:31 +12:00
Daira Hopwood e981001efc orchard_group_hash: add test vectors for map_to_curve_simple_swu.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-04-27 14:28:48 +01:00
Daira Hopwood 634c599fc6 orchard_group_hash: minor refactoring.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-04-27 14:28:08 +01:00
Daira Hopwood 322aff1777 orchard_group_hash.py: don't apply iso_map as part of map_to_curve_simple_swu.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-04-27 14:26:12 +01:00
Taylor Hornby 86c2796de8
Fix broken incomplete addition case check
Co-authored-by: str4d <jack@z.cash>
2021-04-26 23:35:30 -06:00
Jack Grigg 4052b6404b Add rendering logic to Orchard GroupHash and Sinsemilla 2021-04-27 15:41:19 +12:00