Skip to content

Commit c2a9c9f

Browse files
authored
Merge pull request #130 from Zondax/dev
New Release
2 parents 8feb7fe + a296d4e commit c2a9c9f

File tree

14 files changed

+42
-85
lines changed

14 files changed

+42
-85
lines changed

app/Makefile.version

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ APPVERSION_M=4
33
# This is the minor version
44
APPVERSION_N=2
55
# This is the patch version
6-
APPVERSION_P=2
6+
APPVERSION_P=3

app/src/refactor/sighash.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const uint8_t CTX_ZCASH_SHIELDED_OUTPUTS_HASH_PERSONALIZATION[] = "ZcashSOutputH
3636

3737
const uint8_t CONSENSUS_BRANCH_ID_SAPLING[4] = {0xBB, 0x09, 0xB8, 0x76}; // sapling
3838
const uint8_t CONSENSUS_BRANCH_ID_ORCHARD[4] = {0xB4, 0xD0, 0xD6, 0xC2}; // orchard
39+
const uint8_t CONSENSUS_BRANCH_ID_NU6[4] = {0x55, 0x10, 0xE7, 0xC8}; // nu6
3940

4041
zxerr_t sapling_transparent_prevouts_hash(const uint8_t *input, uint8_t *output) {
4142
const uint8_t n = t_inlist_len();
@@ -148,7 +149,7 @@ static zxerr_t signature_hash_v4(const uint8_t *input, uint16_t inputlen, uint8_
148149
cx_blake2b_t ctx = {0};
149150

150151
uint8_t personalization[16] = "ZcashSigHash";
151-
MEMCPY(personalization + 12, CONSENSUS_BRANCH_ID_ORCHARD, 4);
152+
MEMCPY(personalization + 12, CONSENSUS_BRANCH_ID_NU6, 4);
152153

153154
CHECK_CX_OK(cx_blake2b_init2_no_throw(&ctx, 256, NULL, 0, (uint8_t *)personalization, PERSONALIZATION_SIZE));
154155
CHECK_CX_OK(cx_hash_no_throw(&ctx.header, CX_LAST, input, inputlen, output, HASH_SIZE));
@@ -166,7 +167,7 @@ static zxerr_t signature_hash_v5(
166167
cx_blake2b_t ctx = {0};
167168

168169
uint8_t personalization[16] = "ZcashTxHash_";
169-
MEMCPY(personalization + 12, CONSENSUS_BRANCH_ID_ORCHARD, 4);
170+
MEMCPY(personalization + 12, CONSENSUS_BRANCH_ID_NU6, 4);
170171
CHECK_CX_OK(cx_blake2b_init2_no_throw(&ctx, 256, NULL, 0, (uint8_t *)personalization, PERSONALIZATION_SIZE));
171172

172173
uint8_t header_digest[32] = {0};
@@ -215,7 +216,7 @@ static zxerr_t signature_script_hash_v4(
215216

216217
cx_blake2b_t ctx = {0};
217218
uint8_t personalization[16] = "ZcashSigHash";
218-
MEMCPY(personalization + 12, CONSENSUS_BRANCH_ID_ORCHARD, 4);
219+
MEMCPY(personalization + 12, CONSENSUS_BRANCH_ID_NU6, 4);
219220

220221
CHECK_CX_OK(cx_blake2b_init2_no_throw(&ctx, 256, NULL, 0, (uint8_t *)personalization, PERSONALIZATION_SIZE));
221222
CHECK_CX_OK(cx_hash_no_throw(&ctx.header, 0, input, inputlen, NULL, 0));
198 Bytes
Loading
0 Bytes
Loading
0 Bytes
Loading
15 Bytes
Loading
15 Bytes
Loading
190 Bytes
Loading
15 Bytes
Loading
15 Bytes
Loading

zcashtools/Cargo.lock

+31-75
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

zcashtools/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ opt-level = "s"
88
overflow-checks = true
99

1010
[patch.crates-io]
11-
ledger-zcash-builder = { git = "https://github.com/Zondax/ledger-zcash-rs", rev = "0dd05cee4427f2c7ff1bfc9fb11f62f878c0cfa8" }
12-
ledger-zcash = { git = "https://github.com/Zondax/ledger-zcash-rs", rev = "0dd05cee4427f2c7ff1bfc9fb11f62f878c0cfa8" }
11+
ledger-zcash-builder = { git = "https://github.com/Zondax/ledger-zcash-rs", rev = "3bad2fa4a7870270627edc25ebdb5b4818fd1855" }
12+
ledger-zcash = { git = "https://github.com/Zondax/ledger-zcash-rs", rev = "3bad2fa4a7870270627edc25ebdb5b4818fd1855" }
1313

1414
# ledger-zcash-builder = { path = "../../ledger-zcash-rs/ledger-zcash-builder" }
1515
# ledger-zcash = { path = "../../ledger-zcash-rs/ledger-zcash" }

zcashtools/neon/native/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ serde_derive = "1"
1919
serde = "1"
2020
log = "0.4"
2121
snafu = { version = "0.8.2" }
22-
zcash_primitives = { version = "0.7", features = ["transparent-inputs"] }
22+
zcash_primitives = { git = "https://github.com/Zondax/librustzcash", rev = "112eedd27b2e51b9e1b77603a776cd78e738c3ae", features = ["transparent-inputs"], package = "zcash_primitives" }
2323

2424
neon-serde = { git = "https://github.com/Zondax/neon-serde", branch = "master", default-features = false, features = [
2525
"napi-6",
2626
] }
2727

28-
ledger-zcash-builder = "=0.11.2"
29-
ledger-zcash = "0.11.2"
28+
ledger-zcash-builder = { git = "https://github.com/Zondax/ledger-zcash-rs", rev = "3bad2fa4a7870270627edc25ebdb5b4818fd1855", package = "ledger-zcash-builder" }
29+
ledger-zcash = { git = "https://github.com/Zondax/ledger-zcash-rs", rev = "3bad2fa4a7870270627edc25ebdb5b4818fd1855", package = "ledger-zcash" }
3030

3131
[dev-dependencies]
3232
serde = { version = "1", features = ["derive"] }

zcashtools/neon/native/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ impl ZcashBuilderBridge {
218218
AuthorisationStatus::Unauthorized(mut builder) => {
219219
let mut prover =
220220
txprover::LocalTxProver::new(Path::new(spendpath), Path::new(outputpath));
221-
let res = builder.build(consensus::BranchId::Nu5, tx_ver, &mut prover);
221+
let res = builder.build(consensus::BranchId::Nu6, tx_ver, &mut prover);
222222
match res {
223223
Ok(_) => self.zcashbuilder = AuthorisationStatus::Unauthorized(builder),
224224
Err(ref e) => {

0 commit comments

Comments
 (0)