Move remaining scripts out of the root directory.
closes #79 Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
parent
c7f9463713
commit
f07451a025
|
@ -15,8 +15,7 @@ after adjusting:
|
|||
- Install [`poetry`](https://python-poetry.org/).
|
||||
- `poetry install`
|
||||
- `poetry run SCRIPT_NAME [-t json|rust|zcash]`
|
||||
- `SCRIPT_NAME` is either one of the scripts listed in `pyproject.toml`, or
|
||||
one of the Python files in the root directory.
|
||||
- `SCRIPT_NAME` is one of the scripts listed in `pyproject.toml`.
|
||||
|
||||
## License
|
||||
|
||||
|
|
|
@ -31,6 +31,10 @@ secp256k1 = "0.14.0"
|
|||
[tool.poetry.scripts]
|
||||
# General test vectors
|
||||
f4jumble = "zcash_test_vectors.f4jumble:main"
|
||||
f4jumble_long = "zcash_test_vectors.f4jumble_long:main"
|
||||
unified_address = "zcash_test_vectors.unified_address:main"
|
||||
unified_full_viewing_keys = "zcash_test_vectors.unified_full_viewing_keys:main"
|
||||
unified_incoming_viewing_keys = "zcash_test_vectors.unified_incoming_viewing_keys:main"
|
||||
zip_0143 = "zcash_test_vectors.zip_0143:main"
|
||||
zip_0243 = "zcash_test_vectors.zip_0243:main"
|
||||
zip_0244 = "zcash_test_vectors.zip_0244:main"
|
||||
|
@ -44,10 +48,13 @@ sapling_signatures = "zcash_test_vectors.sapling.redjubjub:main"
|
|||
sapling_zip32 = "zcash_test_vectors.sapling.zip32:main"
|
||||
|
||||
# Orchard test vectors
|
||||
orchard_empty_roots = "zcash_test_vectors.orchard.empty_roots:main"
|
||||
orchard_generators = "zcash_test_vectors.orchard.generators:main"
|
||||
orchard_group_hash = "zcash_test_vectors.orchard.group_hash:main"
|
||||
orchard_key_components = "zcash_test_vectors.orchard.key_components:main"
|
||||
orchard_map_to_curve = "zcash_test_vectors.orchard.map_to_curve:main"
|
||||
orchard_merkle_tree = "zcash_test_vectors.orchard.merkle_tree:main"
|
||||
orchard_note_encryption = "zcash_test_vectors.orchard.note_encryption:main"
|
||||
orchard_poseidon = "zcash_test_vectors.orchard.poseidon:main"
|
||||
orchard_poseidon_hash = "zcash_test_vectors.orchard.poseidon_hash:main"
|
||||
orchard_sinsemilla = "zcash_test_vectors.orchard.sinsemilla:main"
|
||||
|
|
|
@ -2,40 +2,32 @@
|
|||
|
||||
tv_scripts=(
|
||||
f4jumble
|
||||
f4jumble_long
|
||||
orchard_empty_roots
|
||||
orchard_generators
|
||||
orchard_group_hash
|
||||
orchard_key_components
|
||||
orchard_map_to_curve
|
||||
orchard_merkle_tree
|
||||
orchard_note_encryption
|
||||
orchard_poseidon
|
||||
orchard_poseidon_hash
|
||||
orchard_sinsemilla
|
||||
sapling_generators
|
||||
sapling_key_components
|
||||
sapling_note_encryption
|
||||
sapling_signatures
|
||||
sapling_zip32
|
||||
unified_address
|
||||
unified_full_viewing_keys
|
||||
unified_incoming_viewing_keys
|
||||
zip_0143
|
||||
zip_0243
|
||||
zip_0244
|
||||
zip_0316)
|
||||
|
||||
tv_external_scripts=(
|
||||
f4jumble_long
|
||||
orchard_empty_roots
|
||||
orchard_map_to_curve
|
||||
orchard_poseidon_hash
|
||||
unified_address
|
||||
unified_full_viewing_keys
|
||||
unified_incoming_viewing_keys)
|
||||
|
||||
for generator in "${tv_scripts[@]}"
|
||||
do
|
||||
echo "# $generator"
|
||||
poetry run $generator -t $1 >test-vectors/$1/$generator.$2
|
||||
done
|
||||
|
||||
for generator in "${tv_external_scripts[@]}"
|
||||
do
|
||||
echo "# $generator"
|
||||
poetry run python ./$generator.py -t $1 >test-vectors/$1/$generator.$2
|
||||
done
|
||||
|
|
|
@ -3,8 +3,8 @@ import sys; assert sys.version_info[0] >= 3, "Python 3 required."
|
|||
|
||||
from hashlib import blake2b
|
||||
|
||||
from zcash_test_vectors.output import render_args, render_tv
|
||||
from zcash_test_vectors.f4jumble import f4jumble, f4jumble_inv, MAX_l_M
|
||||
from .output import render_args, render_tv
|
||||
from .f4jumble import f4jumble, f4jumble_inv, MAX_l_M
|
||||
|
||||
|
||||
def main():
|
|
@ -1,10 +1,11 @@
|
|||
#!/usr/bin/env python3
|
||||
import sys; assert sys.version_info[0] >= 3, "Python 3 required."
|
||||
|
||||
from zcash_test_vectors.orchard.merkle_tree import empty_roots
|
||||
from zcash_test_vectors.orchard.pallas import Fp
|
||||
from zcash_test_vectors.output import render_args, render_tv
|
||||
from zcash_test_vectors.utils import i2lebsp
|
||||
from .merkle_tree import empty_roots
|
||||
from .pallas import Fp
|
||||
|
||||
from ..output import render_args, render_tv
|
||||
from ..utils import i2lebsp
|
||||
|
||||
|
||||
def main():
|
|
@ -1,12 +1,13 @@
|
|||
#!/usr/bin/env python3
|
||||
import sys; assert sys.version_info[0] >= 3, "Python 3 required."
|
||||
|
||||
from zcash_test_vectors.orchard.group_hash import map_to_curve_simple_swu
|
||||
from zcash_test_vectors.orchard.iso_pallas import Point as IsoPoint
|
||||
from zcash_test_vectors.orchard.pallas import Fp
|
||||
from zcash_test_vectors.utils import leos2ip
|
||||
from zcash_test_vectors.output import render_args, render_tv
|
||||
from zcash_test_vectors.rand import Rand
|
||||
from .group_hash import map_to_curve_simple_swu
|
||||
from .iso_pallas import Point as IsoPoint
|
||||
from .pallas import Fp
|
||||
|
||||
from ..utils import leos2ip
|
||||
from ..output import render_args, render_tv
|
||||
from ..rand import Rand
|
||||
|
||||
|
||||
def main():
|
|
@ -1,11 +1,12 @@
|
|||
#!/usr/bin/env python3
|
||||
import sys; assert sys.version_info[0] >= 3, "Python 3 required."
|
||||
|
||||
from zcash_test_vectors.orchard.pallas import Fp
|
||||
from zcash_test_vectors.orchard import poseidon
|
||||
from zcash_test_vectors.utils import leos2ip
|
||||
from zcash_test_vectors.output import render_args, render_tv
|
||||
from zcash_test_vectors.rand import Rand
|
||||
from .pallas import Fp
|
||||
from . import poseidon
|
||||
|
||||
from ..utils import leos2ip
|
||||
from ..output import render_args, render_tv
|
||||
from ..rand import Rand
|
||||
|
||||
def main():
|
||||
test_vectors = [[Fp.ZERO, Fp(1)]]
|
|
@ -5,16 +5,16 @@ import math
|
|||
from random import Random
|
||||
import struct
|
||||
|
||||
from zcash_test_vectors.bech32m import bech32_encode, bech32_decode, convertbits, Encoding
|
||||
from .bech32m import bech32_encode, bech32_decode, convertbits, Encoding
|
||||
|
||||
from zcash_test_vectors.output import render_args, render_tv, Some
|
||||
from zcash_test_vectors.rand import Rand, randbytes
|
||||
from zcash_test_vectors.zc_utils import write_compact_size, parse_compact_size
|
||||
from zcash_test_vectors.f4jumble import f4jumble, f4jumble_inv
|
||||
from zcash_test_vectors.sapling import key_components as sapling_key_components
|
||||
from zcash_test_vectors.orchard import key_components as orchard_key_components
|
||||
from zcash_test_vectors.unified_encoding import encode_unified, decode_unified
|
||||
from zcash_test_vectors.unified_encoding import P2PKH_ITEM, P2SH_ITEM, SAPLING_ITEM, ORCHARD_ITEM
|
||||
from .output import render_args, render_tv, Some
|
||||
from .rand import Rand, randbytes
|
||||
from .zc_utils import write_compact_size, parse_compact_size
|
||||
from .f4jumble import f4jumble, f4jumble_inv
|
||||
from .sapling import key_components as sapling_key_components
|
||||
from .orchard import key_components as orchard_key_components
|
||||
from .unified_encoding import encode_unified, decode_unified
|
||||
from .unified_encoding import P2PKH_ITEM, P2SH_ITEM, SAPLING_ITEM, ORCHARD_ITEM
|
||||
|
||||
def main():
|
||||
args = render_args()
|
|
@ -6,12 +6,12 @@ from random import Random
|
|||
from cryptography.hazmat.primitives.asymmetric import ec
|
||||
from cryptography.hazmat.primitives.serialization import PublicFormat, Encoding
|
||||
|
||||
from zcash_test_vectors.output import render_args, render_tv, Some
|
||||
from zcash_test_vectors.rand import Rand, randbytes
|
||||
from zcash_test_vectors.orchard import key_components as orchard_key_components
|
||||
from zcash_test_vectors.sapling import zip32 as sapling_zip32
|
||||
from zcash_test_vectors.unified_encoding import encode_unified, decode_unified
|
||||
from zcash_test_vectors.unified_encoding import P2PKH_ITEM, SAPLING_ITEM, ORCHARD_ITEM
|
||||
from .output import render_args, render_tv, Some
|
||||
from .rand import Rand, randbytes
|
||||
from .orchard import key_components as orchard_key_components
|
||||
from .sapling import zip32 as sapling_zip32
|
||||
from .unified_encoding import encode_unified, decode_unified
|
||||
from .unified_encoding import P2PKH_ITEM, SAPLING_ITEM, ORCHARD_ITEM
|
||||
|
||||
def main():
|
||||
args = render_args()
|
|
@ -6,12 +6,12 @@ from random import Random
|
|||
from cryptography.hazmat.primitives.asymmetric import ec
|
||||
from cryptography.hazmat.primitives.serialization import PublicFormat, Encoding
|
||||
|
||||
from zcash_test_vectors.output import render_args, render_tv, Some
|
||||
from zcash_test_vectors.rand import Rand, randbytes
|
||||
from zcash_test_vectors.orchard import key_components as orchard_key_components
|
||||
from zcash_test_vectors.sapling import zip32 as sapling_zip32
|
||||
from zcash_test_vectors.unified_encoding import encode_unified, decode_unified
|
||||
from zcash_test_vectors.unified_encoding import P2PKH_ITEM, SAPLING_ITEM, ORCHARD_ITEM
|
||||
from .output import render_args, render_tv, Some
|
||||
from .rand import Rand, randbytes
|
||||
from .orchard import key_components as orchard_key_components
|
||||
from .sapling import zip32 as sapling_zip32
|
||||
from .unified_encoding import encode_unified, decode_unified
|
||||
from .unified_encoding import P2PKH_ITEM, SAPLING_ITEM, ORCHARD_ITEM
|
||||
|
||||
def main():
|
||||
args = render_args()
|
Loading…
Reference in New Issue