diff --git a/unified_full_viewing_keys.py b/unified_full_viewing_keys.py index 3ab75d4..3796623 100755 --- a/unified_full_viewing_keys.py +++ b/unified_full_viewing_keys.py @@ -47,9 +47,9 @@ def main(): sapling_fvk = account_key.to_extended_fvk() sapling_fvk_bytes = b"".join([ - bytes(sapling_fvk.ak()), - bytes(sapling_fvk.nk()), - sapling_fvk.ovk(), + bytes(sapling_fvk.ak()), + bytes(sapling_fvk.nk()), + sapling_fvk.ovk(), sapling_fvk.dk() ]) else: @@ -60,17 +60,17 @@ def main(): orchard_sk = orchard_key_components.SpendingKey(rand.b(32)) orchard_fvk = orchard_key_components.FullViewingKey.from_spending_key(orchard_sk) orchard_fvk_bytes = b"".join([ - bytes(orchard_fvk.ak), + bytes(orchard_fvk.ak), bytes(orchard_fvk.nk), bytes(orchard_fvk.rivk) ]) else: orchard_fvk_bytes = None - # include an unknown item 1/4 of the time + # include an unknown item 1/4 of the time has_unknown_item = rand.bool() and rand.bool() # use the range reserved for experimental typecodes for unknowns - unknown_tc = rng.randrange(0xFFFA, 0xFFFF+1) + unknown_tc = rng.randrange(0xFFFA, 0xFFFF+1) unknown_len = rng.randrange(32, 256) if has_unknown_item: unknown_bytes = b"".join([rand.b(unknown_len)]) diff --git a/zcash_test_vectors/sapling/zip32.py b/zcash_test_vectors/sapling/zip32.py index 27174d3..5d2ec2f 100755 --- a/zcash_test_vectors/sapling/zip32.py +++ b/zcash_test_vectors/sapling/zip32.py @@ -214,10 +214,11 @@ class ExtendedFullViewingKey(DerivedIvk, ExtendedBase): return self.__class__(self.ak(), nk_internal, ovk_internal, dk_internal, self._c, self.depth(), self.parent_tag(), self._i) -def hardened(i): +def hardened(i): assert(i < (1<<31)) return i + (1<<31) + def main(): args = render_args()