diff --git a/app/Makefile.version b/app/Makefile.version index 4f5f98ca..82feb033 100644 --- a/app/Makefile.version +++ b/app/Makefile.version @@ -3,4 +3,4 @@ APPVERSION_M=4 # This is the minor version APPVERSION_N=2 # This is the patch version -APPVERSION_P=2 +APPVERSION_P=3 diff --git a/app/src/refactor/sighash.c b/app/src/refactor/sighash.c index c43e2375..c95834ef 100644 --- a/app/src/refactor/sighash.c +++ b/app/src/refactor/sighash.c @@ -36,6 +36,7 @@ const uint8_t CTX_ZCASH_SHIELDED_OUTPUTS_HASH_PERSONALIZATION[] = "ZcashSOutputH const uint8_t CONSENSUS_BRANCH_ID_SAPLING[4] = {0xBB, 0x09, 0xB8, 0x76}; // sapling const uint8_t CONSENSUS_BRANCH_ID_ORCHARD[4] = {0xB4, 0xD0, 0xD6, 0xC2}; // orchard +const uint8_t CONSENSUS_BRANCH_ID_NU6[4] = {0x55, 0x10, 0xE7, 0xC8}; // nu6 zxerr_t sapling_transparent_prevouts_hash(const uint8_t *input, uint8_t *output) { 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_ cx_blake2b_t ctx = {0}; uint8_t personalization[16] = "ZcashSigHash"; - MEMCPY(personalization + 12, CONSENSUS_BRANCH_ID_ORCHARD, 4); + MEMCPY(personalization + 12, CONSENSUS_BRANCH_ID_NU6, 4); CHECK_CX_OK(cx_blake2b_init2_no_throw(&ctx, 256, NULL, 0, (uint8_t *)personalization, PERSONALIZATION_SIZE)); 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( cx_blake2b_t ctx = {0}; uint8_t personalization[16] = "ZcashTxHash_"; - MEMCPY(personalization + 12, CONSENSUS_BRANCH_ID_ORCHARD, 4); + MEMCPY(personalization + 12, CONSENSUS_BRANCH_ID_NU6, 4); CHECK_CX_OK(cx_blake2b_init2_no_throw(&ctx, 256, NULL, 0, (uint8_t *)personalization, PERSONALIZATION_SIZE)); uint8_t header_digest[32] = {0}; @@ -215,7 +216,7 @@ static zxerr_t signature_script_hash_v4( cx_blake2b_t ctx = {0}; uint8_t personalization[16] = "ZcashSigHash"; - MEMCPY(personalization + 12, CONSENSUS_BRANCH_ID_ORCHARD, 4); + MEMCPY(personalization + 12, CONSENSUS_BRANCH_ID_NU6, 4); CHECK_CX_OK(cx_blake2b_init2_no_throw(&ctx, 256, NULL, 0, (uint8_t *)personalization, PERSONALIZATION_SIZE)); CHECK_CX_OK(cx_hash_no_throw(&ctx.header, 0, input, inputlen, NULL, 0)); diff --git a/tests_zemu/snapshots/fl-mainmenu/00004.png b/tests_zemu/snapshots/fl-mainmenu/00004.png index e8229288..fa946076 100644 Binary files a/tests_zemu/snapshots/fl-mainmenu/00004.png and b/tests_zemu/snapshots/fl-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/s-mainmenu/00004.png b/tests_zemu/snapshots/s-mainmenu/00004.png index 99401b22..a78e6827 100644 Binary files a/tests_zemu/snapshots/s-mainmenu/00004.png and b/tests_zemu/snapshots/s-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/s-mainmenu/00010.png b/tests_zemu/snapshots/s-mainmenu/00010.png index 99401b22..a78e6827 100644 Binary files a/tests_zemu/snapshots/s-mainmenu/00010.png and b/tests_zemu/snapshots/s-mainmenu/00010.png differ diff --git a/tests_zemu/snapshots/sp-mainmenu/00004.png b/tests_zemu/snapshots/sp-mainmenu/00004.png index cf1ce0a4..500d0b8f 100644 Binary files a/tests_zemu/snapshots/sp-mainmenu/00004.png and b/tests_zemu/snapshots/sp-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/sp-mainmenu/00010.png b/tests_zemu/snapshots/sp-mainmenu/00010.png index cf1ce0a4..500d0b8f 100644 Binary files a/tests_zemu/snapshots/sp-mainmenu/00010.png and b/tests_zemu/snapshots/sp-mainmenu/00010.png differ diff --git a/tests_zemu/snapshots/st-mainmenu/00004.png b/tests_zemu/snapshots/st-mainmenu/00004.png index c8ba170d..f07b2ba3 100644 Binary files a/tests_zemu/snapshots/st-mainmenu/00004.png and b/tests_zemu/snapshots/st-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/x-mainmenu/00004.png b/tests_zemu/snapshots/x-mainmenu/00004.png index cf1ce0a4..500d0b8f 100644 Binary files a/tests_zemu/snapshots/x-mainmenu/00004.png and b/tests_zemu/snapshots/x-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/x-mainmenu/00010.png b/tests_zemu/snapshots/x-mainmenu/00010.png index cf1ce0a4..500d0b8f 100644 Binary files a/tests_zemu/snapshots/x-mainmenu/00010.png and b/tests_zemu/snapshots/x-mainmenu/00010.png differ diff --git a/zcashtools/Cargo.lock b/zcashtools/Cargo.lock index 09389f58..553a48a6 100644 --- a/zcashtools/Cargo.lock +++ b/zcashtools/Cargo.lock @@ -52,9 +52,9 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "async-trait" -version = "0.1.80" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", @@ -450,9 +450,8 @@ dependencies = [ [[package]] name = "equihash" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab579d7cf78477773b03e80bc2f89702ef02d7112c711d54ca93dcdce68533d5" +version = "0.1.0" +source = "git+https://github.com/Zondax/librustzcash?rev=112eedd27b2e51b9e1b77603a776cd78e738c3ae#112eedd27b2e51b9e1b77603a776cd78e738c3ae" dependencies = [ "blake2b_simd", "byteorder", @@ -529,9 +528,9 @@ dependencies = [ [[package]] name = "halo2_gadgets" -version = "0.2.0" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85e10bf9924da1754e443641c9e7f9f00483749f8fb837fde696ef6ed6e2f079" +checksum = "13f3914f58cc4af5e4fe83d48b02d582be18976bc7e96c3151aa2bf1c98e9f60" dependencies = [ "arrayvec", "bitvec", @@ -547,9 +546,9 @@ dependencies = [ [[package]] name = "halo2_proofs" -version = "0.2.0" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff771b9a2445cd2545c9ef26d863c290fbb44ae440c825a20eb7156f67a949a" +checksum = "e925780549adee8364c7f2b685c753f6f3df23bde520c67416e93bf615933760" dependencies = [ "blake2b_simd", "ff", @@ -557,7 +556,6 @@ dependencies = [ "pasta_curves", "rand_core", "rayon", - "tracing", ] [[package]] @@ -668,7 +666,7 @@ dependencies = [ [[package]] name = "ledger-zcash" version = "0.11.2" -source = "git+https://github.com/Zondax/ledger-zcash-rs?rev=0dd05cee4427f2c7ff1bfc9fb11f62f878c0cfa8#0dd05cee4427f2c7ff1bfc9fb11f62f878c0cfa8" +source = "git+https://github.com/Zondax/ledger-zcash-rs?rev=3bad2fa4a7870270627edc25ebdb5b4818fd1855#3bad2fa4a7870270627edc25ebdb5b4818fd1855" dependencies = [ "arrayvec", "byteorder", @@ -697,7 +695,7 @@ dependencies = [ [[package]] name = "ledger-zcash-builder" version = "0.11.2" -source = "git+https://github.com/Zondax/ledger-zcash-rs?rev=0dd05cee4427f2c7ff1bfc9fb11f62f878c0cfa8#0dd05cee4427f2c7ff1bfc9fb11f62f878c0cfa8" +source = "git+https://github.com/Zondax/ledger-zcash-rs?rev=3bad2fa4a7870270627edc25ebdb5b4818fd1855#3bad2fa4a7870270627edc25ebdb5b4818fd1855" dependencies = [ "bellman", "blake2b_simd", @@ -722,7 +720,7 @@ dependencies = [ "sha2 0.10.8", "thiserror", "tokio", - "zcash_note_encryption", + "zcash_note_encryption 0.1.0 (git+https://github.com/Zondax/librustzcash?rev=112eedd27b2e51b9e1b77603a776cd78e738c3ae)", "zcash_primitives", "zcash_proofs", ] @@ -969,9 +967,9 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "orchard" -version = "0.2.0" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7619db7f917afd9b1139044c595fab1b6166de2db62317794b5f5e34a2104ae1" +checksum = "f918076e191a68d55c5517a16e075ecfe58fc63ed112408263f3d6194597bfcf" dependencies = [ "aes", "bitvec", @@ -991,8 +989,7 @@ dependencies = [ "reddsa", "serde", "subtle", - "tracing", - "zcash_note_encryption", + "zcash_note_encryption 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1154,22 +1151,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "redjubjub" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6039ff156887caf92df308cbaccdc058c9d3155a913da046add6e48c4cdbd91d" -dependencies = [ - "blake2b_simd", - "byteorder", - "digest 0.9.0", - "jubjub", - "rand_core", - "serde", - "thiserror", - "zeroize", -] - [[package]] name = "redox_users" version = "0.4.5" @@ -1452,37 +1433,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.61", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - [[package]] name = "typenum" version = "1.17.0" @@ -1642,8 +1592,7 @@ dependencies = [ [[package]] name = "zcash_encoding" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb61ea88eb539bc0ac2068e5da99411dd4978595b3d7ff6a4b1562ddc8e8710" +source = "git+https://github.com/Zondax/librustzcash?rev=112eedd27b2e51b9e1b77603a776cd78e738c3ae#112eedd27b2e51b9e1b77603a776cd78e738c3ae" dependencies = [ "byteorder", "nonempty", @@ -1661,11 +1610,21 @@ dependencies = [ "subtle", ] +[[package]] +name = "zcash_note_encryption" +version = "0.1.0" +source = "git+https://github.com/Zondax/librustzcash?rev=112eedd27b2e51b9e1b77603a776cd78e738c3ae#112eedd27b2e51b9e1b77603a776cd78e738c3ae" +dependencies = [ + "chacha20", + "chacha20poly1305", + "rand_core", + "subtle", +] + [[package]] name = "zcash_primitives" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fbb401f5dbc482b831954aaa7cba0a8fe148241db6d19fe7cebda78252ca680" +version = "0.6.0" +source = "git+https://github.com/Zondax/librustzcash?rev=112eedd27b2e51b9e1b77603a776cd78e738c3ae#112eedd27b2e51b9e1b77603a776cd78e738c3ae" dependencies = [ "aes", "bip0039", @@ -1695,14 +1654,13 @@ dependencies = [ "sha2 0.9.9", "subtle", "zcash_encoding", - "zcash_note_encryption", + "zcash_note_encryption 0.1.0 (git+https://github.com/Zondax/librustzcash?rev=112eedd27b2e51b9e1b77603a776cd78e738c3ae)", ] [[package]] name = "zcash_proofs" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98bf5f6af051dd929263f279b21b9c04c1f30116c70f3c190de2566677f245ef" +version = "0.6.0" +source = "git+https://github.com/Zondax/librustzcash?rev=112eedd27b2e51b9e1b77603a776cd78e738c3ae#112eedd27b2e51b9e1b77603a776cd78e738c3ae" dependencies = [ "bellman", "blake2b_simd", @@ -1714,8 +1672,6 @@ dependencies = [ "jubjub", "lazy_static", "rand_core", - "redjubjub", - "tracing", "zcash_primitives", ] diff --git a/zcashtools/Cargo.toml b/zcashtools/Cargo.toml index 70f40548..28f590b4 100644 --- a/zcashtools/Cargo.toml +++ b/zcashtools/Cargo.toml @@ -8,8 +8,8 @@ opt-level = "s" overflow-checks = true [patch.crates-io] -ledger-zcash-builder = { git = "https://github.com/Zondax/ledger-zcash-rs", rev = "0dd05cee4427f2c7ff1bfc9fb11f62f878c0cfa8" } -ledger-zcash = { git = "https://github.com/Zondax/ledger-zcash-rs", rev = "0dd05cee4427f2c7ff1bfc9fb11f62f878c0cfa8" } +ledger-zcash-builder = { git = "https://github.com/Zondax/ledger-zcash-rs", rev = "3bad2fa4a7870270627edc25ebdb5b4818fd1855" } +ledger-zcash = { git = "https://github.com/Zondax/ledger-zcash-rs", rev = "3bad2fa4a7870270627edc25ebdb5b4818fd1855" } # ledger-zcash-builder = { path = "../../ledger-zcash-rs/ledger-zcash-builder" } # ledger-zcash = { path = "../../ledger-zcash-rs/ledger-zcash" } diff --git a/zcashtools/neon/native/Cargo.toml b/zcashtools/neon/native/Cargo.toml index 5986da2a..b3a526fc 100644 --- a/zcashtools/neon/native/Cargo.toml +++ b/zcashtools/neon/native/Cargo.toml @@ -19,14 +19,14 @@ serde_derive = "1" serde = "1" log = "0.4" snafu = { version = "0.8.2" } -zcash_primitives = { version = "0.7", features = ["transparent-inputs"] } +zcash_primitives = { git = "https://github.com/Zondax/librustzcash", rev = "112eedd27b2e51b9e1b77603a776cd78e738c3ae", features = ["transparent-inputs"], package = "zcash_primitives" } neon-serde = { git = "https://github.com/Zondax/neon-serde", branch = "master", default-features = false, features = [ "napi-6", ] } -ledger-zcash-builder = "=0.11.2" -ledger-zcash = "0.11.2" +ledger-zcash-builder = { git = "https://github.com/Zondax/ledger-zcash-rs", rev = "3bad2fa4a7870270627edc25ebdb5b4818fd1855", package = "ledger-zcash-builder" } +ledger-zcash = { git = "https://github.com/Zondax/ledger-zcash-rs", rev = "3bad2fa4a7870270627edc25ebdb5b4818fd1855", package = "ledger-zcash" } [dev-dependencies] serde = { version = "1", features = ["derive"] } diff --git a/zcashtools/neon/native/src/lib.rs b/zcashtools/neon/native/src/lib.rs index 52df2e2e..83ceaab8 100644 --- a/zcashtools/neon/native/src/lib.rs +++ b/zcashtools/neon/native/src/lib.rs @@ -218,7 +218,7 @@ impl ZcashBuilderBridge { AuthorisationStatus::Unauthorized(mut builder) => { let mut prover = txprover::LocalTxProver::new(Path::new(spendpath), Path::new(outputpath)); - let res = builder.build(consensus::BranchId::Nu5, tx_ver, &mut prover); + let res = builder.build(consensus::BranchId::Nu6, tx_ver, &mut prover); match res { Ok(_) => self.zcashbuilder = AuthorisationStatus::Unauthorized(builder), Err(ref e) => {