Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding upstream changes to zsa1 #20

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ zip_0244 = "zcash_test_vectors.zip_0244:main"
# Transparent test vectors
bip_0032 = "zcash_test_vectors.transparent.bip_0032:main"
zip_0316 = "zcash_test_vectors.transparent.zip_0316:main"
zip_0320 = "zcash_test_vectors.transparent.zip_0320:main"

# Sapling test vectors
sapling_generators = "zcash_test_vectors.sapling.generators:main"
Expand Down
3 changes: 2 additions & 1 deletion regenerate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ tv_scripts=(
zip_0143
zip_0243
zip_0244
zip_0316)
zip_0316
zip_0320)

for generator in "${tv_scripts[@]}"
do
Expand Down
19 changes: 19 additions & 0 deletions test-vectors/json/zip_0320.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[
["From https://github.com/zcash-hackworks/zcash-test-vectors/blob/master/zcash_test_vectors/transparent/zip_0320.py"],
["t_addr, p2pkh_bytes, tex_addr, account, child_index"],
["t1V9mnyk5Z5cTNMCkLbaDwSskgJZucTLdgW", "7bb83570b8fae146e03c5331a020b1e0892f631d", "tex10wur2u9clts5dcpu2vc6qg93uzyj7cca2xm732", 0, 0],
["t1LZdE42PAt1wREUv1YMYRFwJDPHPW8toLL", "1d81e86791c72d292f906e7c039a729e4b1ff7fc", "tex1rkq7seu3cukjjtusde7q8xnjne93laluyvdxu7", 0, 1],
["t1M5AgJw56FNFRBNGtzAGX4AHfQh7ZCxd4w", "231839e305c0a02ed681406faf222585f6623904", "tex1yvvrncc9czsza45pgph67g39shmxywgyvsypwn", 0, 2],
["t1bh6KjXccz6Ed45vFc3GeqoxWbwPxe8w2n", "c3755398b8b77f633fca7ccbda900831478979c9", "tex1cd648x9ckalkx0720n9a4yqgx9rcj7wfvjcq63", 1, 0],
["t1WvCtHojWHSHBdDtCFgorUN1TzUFV8sCth", "8f17950e22b08886ac4832e22e24f2e8f3cb6b21", "tex13ute2r3zkzygdtzgxt3zuf8jareuk6ep7qd8ty", 1, 1],
["t1U2MF7f81qrXkWouT3Xt4hLDAMjC9LniTK", "6f58adaf02bb48e6b398a442a2b294589e041620", "tex1dav2mtczhdywdvuc53p29v55tz0qg93qvfjp46", 1, 2],
["t1awMYfhispKsnJPHn7jgUxNnVW1DTpTJx9", "bb2fbb540f0f7e434636680eaea2eefe375a7591", "tex1hvhmk4q0palyx33kdq82aghwlcm45av3ezlrzn", 2, 0],
["t1Kgn7v5a2rKkxC24LoXNyHRn4q4Gs3KEEF", "13e41e47448122cad13c5c7f5bd31c77639a9f99", "tex1z0jpu36ysy3v45fut3l4h5cuwa3e48uea95pc6", 2, 1],
["t1c1ixUTuStCzo19qPg89U9XFYmWDLru9mt", "c6fb64d8757e5c85b230a3358711697ae6540b44", "tex1cmakfkr40ewgtv3s5v6cwytf0tn9gz6y9j5z8e", 2, 2],
["t1WBxR5jNWgg4Cqeot3FvNkBb9ztYyjVELp", "871a089d446268aa7ac03d2a6f60ae70808f3974", "tex1sudq382yvf5257kq854x7c9wwzqg7wt5h2c24u", 3, 0],
["t1VEuDXP1QocoNaxrq4gZArTqqKCZdrwjG7", "7cb07c31b58040ac7cc12bfaaa138cfbefb38457", "tex10jc8cvd4spq2clxp90a25yuvl0hm8pzheuufxw", 3, 1],
["t1PXVM8oR6qVrVjtcnU1iNmH2CfvZyBai8u", "3e02e08b5965fce9c20ce6de6f9407674d01ba02", "tex18cpwpz6evh7wnssvum0xl9q8vaxsrwsz83vght", 3, 2],
["t1M3p1MgJCgjq4FMogS84kVvuszJbxPnpSM", "22d68debb3928da4046370d25ed2bbe8d5e985d0", "tex1yttgm6anj2x6gprrwrf9a54mar27npws73jwdy", 4, 0],
["t1aqnebXhA45WpgQHLiXTPU1Kk6rp8vVDDr", "ba2230b41fdc81714328231f40ab73feb52645a4", "tex1hg3rpdqlmjqhzsegyv05p2mnl66jv3dykth955", 4, 1],
["t1UG6FVxexmJRFXG4gvEmSF9HSTwHMFaSDT", "71f1fc6fd69370f23611536b3b64e7df1cebef69", "tex1w8clcm7kjdc0yds32d4nke88muwwhmmfunhkhd", 4, 2]
]
365 changes: 182 additions & 183 deletions test-vectors/rust/bip_0032.rs

Large diffs are not rendered by default.

133 changes: 66 additions & 67 deletions test-vectors/rust/f4jumble.rs

Large diffs are not rendered by default.

29 changes: 14 additions & 15 deletions test-vectors/rust/f4jumble_long.rs
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
// From https://github.com/zcash-hackworks/zcash-test-vectors/ (f4jumble_long)

pub(crate) struct TestVector {
pub(crate) length: usize,
pub(crate) jumbled_hash: [u8; 64],
}

// From https://github.com/zcash-hackworks/zcash-test-vectors/blob/master/f4jumble_long.py
pub(crate) fn test_vectors() -> Vec<TestVector> {
vec![
TestVector {
length: 3246395,
jumbled_hash: [
0x3f, 0xc2, 0xec, 0xdf, 0xb6, 0x86, 0x96, 0x57, 0x1d, 0x89, 0xe8, 0xbe, 0xdd, 0xb6, 0x47, 0xe6, 0x99, 0x0b, 0x63, 0xa0, 0x17, 0x1c, 0x36, 0x44, 0x22, 0x73, 0xd6, 0x87, 0xbd, 0x99, 0x25, 0x7e, 0xc5, 0x00, 0x2e, 0xc8, 0x19, 0x78, 0x01, 0xb6, 0x21, 0x73, 0x2d, 0x6b, 0x05, 0xb8, 0xd7, 0x0f, 0x68, 0x86, 0x20, 0xa4, 0xc0, 0x88, 0x73, 0xc1, 0x2e, 0x44, 0x39, 0xa0, 0x12, 0x7d, 0xc9, 0x45
],
},
TestVector {
length: 4194368,
jumbled_hash: [
0xa5, 0xf1, 0x8f, 0x16, 0x3e, 0x59, 0x8d, 0x4a, 0xdb, 0x6e, 0xa7, 0x24, 0x80, 0x57, 0xe2, 0x4c, 0x1b, 0x61, 0xf2, 0x9b, 0x33, 0xb7, 0xab, 0xcd, 0xab, 0xd4, 0x20, 0xa0, 0xf2, 0xee, 0x6c, 0x3e, 0xd3, 0x13, 0x94, 0x65, 0x2f, 0x28, 0xb5, 0x9c, 0x44, 0xd3, 0xea, 0x9e, 0xcf, 0x85, 0xf4, 0xd5, 0x01, 0xe6, 0xaa, 0xc1, 0x4d, 0xf2, 0x88, 0xef, 0xd6, 0x2c, 0xf8, 0x0d, 0x18, 0x29, 0xd0, 0x25
],
},
]
TestVector {
length: 3246395,
jumbled_hash: [
0x3f, 0xc2, 0xec, 0xdf, 0xb6, 0x86, 0x96, 0x57, 0x1d, 0x89, 0xe8, 0xbe, 0xdd, 0xb6, 0x47, 0xe6, 0x99, 0x0b, 0x63, 0xa0, 0x17, 0x1c, 0x36, 0x44, 0x22, 0x73, 0xd6, 0x87, 0xbd, 0x99, 0x25, 0x7e, 0xc5, 0x00, 0x2e, 0xc8, 0x19, 0x78, 0x01, 0xb6, 0x21, 0x73, 0x2d, 0x6b, 0x05, 0xb8, 0xd7, 0x0f, 0x68, 0x86, 0x20, 0xa4, 0xc0, 0x88, 0x73, 0xc1, 0x2e, 0x44, 0x39, 0xa0, 0x12, 0x7d, 0xc9, 0x45
],
},
TestVector {
length: 4194368,
jumbled_hash: [
0xa5, 0xf1, 0x8f, 0x16, 0x3e, 0x59, 0x8d, 0x4a, 0xdb, 0x6e, 0xa7, 0x24, 0x80, 0x57, 0xe2, 0x4c, 0x1b, 0x61, 0xf2, 0x9b, 0x33, 0xb7, 0xab, 0xcd, 0xab, 0xd4, 0x20, 0xa0, 0xf2, 0xee, 0x6c, 0x3e, 0xd3, 0x13, 0x94, 0x65, 0x2f, 0x28, 0xb5, 0x9c, 0x44, 0xd3, 0xea, 0x9e, 0xcf, 0x85, 0xf4, 0xd5, 0x01, 0xe6, 0xaa, 0xc1, 0x4d, 0xf2, 0x88, 0xef, 0xd6, 0x2c, 0xf8, 0x0d, 0x18, 0x29, 0xd0, 0x25
],
},
]
}
3 changes: 1 addition & 2 deletions test-vectors/rust/orchard_empty_roots.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// From https://github.com/zcash-hackworks/zcash-test-vectors/ (orchard_empty_roots)

pub(crate) struct TestVector {
pub(crate) empty_roots: [[u8; 32]; 33],
}

// From https://github.com/zcash-hackworks/zcash-test-vectors/blob/master/orchard_empty_roots.py
let test_vector = TestVector {
empty_roots: [
[0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
Expand Down
3 changes: 1 addition & 2 deletions test-vectors/rust/orchard_generators.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// From https://github.com/zcash-hackworks/zcash-test-vectors/ (orchard_generators)

pub(crate) struct TestVector {
pub(crate) skb: [u8; 32],
pub(crate) nkb: [u8; 32],
Expand All @@ -12,6 +10,7 @@ pub(crate) struct TestVector {
pub(crate) mcq: [u8; 32],
}

// From https://github.com/zcash-hackworks/zcash-test-vectors/blob/master/orchard_generators.py
let test_vector = TestVector {
skb: [
0x63, 0xc9, 0x75, 0xb8, 0x84, 0x72, 0x1a, 0x8d, 0x0c, 0xa1, 0x70, 0x7b, 0xe3, 0x0c, 0x7f, 0x0c, 0x5f, 0x44, 0x5f, 0x3e, 0x7c, 0x18, 0x8d, 0x3b, 0x06, 0xd6, 0xf1, 0x28, 0xb3, 0x23, 0x55, 0xb7
Expand Down
Loading
Loading