Commit Graph

9 Commits

Author SHA1 Message Date
Jack Grigg 13ea1ab387 Generate hardened-only Sapling ZIP 32 test vectors 2023-11-22 02:59:04 +00:00
Daira Hopwood 68e4ed1ee2 Change the seed used for Unified Address, IVK and FVK test vectors to be deterministic.
As of this commit, this only affects the Sapling test vectors (we still sample the same
randomness to avoid disturbing the others).

A "diversifier_index" field is added to the Unified Address test vectors. (This is not needed
for UIVKs/UFVKs since they do not depend on the diversifier index for any protocol.)

We also add an "account" field to make the account number explicit, even though it could be
inferred from the test vector index.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-02-11 16:29:14 +00:00
Daira Hopwood 060ea786f7 Refactor Zcash SLIP 44 coin type and the `hardened` function into a separate file,
since they are not specific to Sapling.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-02-11 16:29:14 +00:00
Daira Hopwood 49a20a87d7 Remove dependency on pyblake2.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-02-02 02:44:40 +00:00
Daira Hopwood 674dc7c054 Cosmetics.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-02-01 20:29:09 +00:00
Daira Hopwood f7f726bf0d Add `internal_ivk` and `internal_fp` to Sapling internal key test vector fields.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-02-01 20:29:09 +00:00
Daira Hopwood b955625f52 Calls to `self.tag()` in Sapling internal key derivation should have been to `self.parent_tag()`
Co-authored-by: Ying Tong Lai <yingtong@z.cash>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-02-01 20:29:09 +00:00
Daira Hopwood b10115d363 Add test vectors for Sapling internal key derivation.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-02-01 20:29:09 +00:00
Jack Grigg 2093b309f4 Refactor test vectors into package
Scripts that were previously run via:
    poetry run python ./SCRIPT_NAME.py

and have been moved, can now be run as:
    poetry run SCRIPT_NAME

Some top-level scripts remain, where they only generate test vectors and
do not contain any Zcash logic. These now use the `zcash_test_vectors`
package, and can't be run directly unless this package is made available
in `PYTHONPATH`.
2022-01-13 02:46:20 +00:00