diff --git a/app/Makefile.version b/app/Makefile.version index feba49af..dafc508e 100644 --- a/app/Makefile.version +++ b/app/Makefile.version @@ -3,4 +3,4 @@ APPVERSION_M=4 # This is the minor version APPVERSION_N=1 # This is the patch version -APPVERSION_P=3 +APPVERSION_P=4 diff --git a/app/rust/src/bolos/blake2b.rs b/app/rust/src/bolos/blake2b.rs index a263c68e..c1e7c204 100644 --- a/app/rust/src/bolos/blake2b.rs +++ b/app/rust/src/bolos/blake2b.rs @@ -241,11 +241,23 @@ pub fn blake2b_expand_v4( .hash_length(64) .personal(PRF_EXPAND_PERSONALIZATION) .to_state(); + crate::bolos::heartbeat(); + blake2b_state.update(in_a); + crate::bolos::heartbeat(); + blake2b_state.update(in_b); + crate::bolos::heartbeat(); + blake2b_state.update(in_c); + crate::bolos::heartbeat(); + blake2b_state.update(in_d); + crate::bolos::heartbeat(); + blake2b_state.update(in_e); + crate::bolos::heartbeat(); + let mut hash = [0u8; 64]; hash.copy_from_slice(blake2b_state.finalize().as_bytes()); hash diff --git a/app/rust/src/zip32.rs b/app/rust/src/zip32.rs index 679f9d21..db83ecba 100644 --- a/app/rust/src/zip32.rs +++ b/app/rust/src/zip32.rs @@ -263,6 +263,8 @@ fn zip32_sapling_derive_child( path_i: u32, key_bundle_i: &mut SaplingKeyBundle, ) { + crate::bolos::heartbeat(); + let hardened = (path_i & 0x8000_0000) != 0; let c = path_i & 0x7FFF_FFFF; @@ -321,6 +323,7 @@ fn zip32_sapling_derive_child( pub fn zip32_sapling_derive(path: &Zip32Path) -> SaplingKeyBundle { // ik as in capital I (https://zips.z.cash/zip-0032#sapling-child-key-derivation) let mut ik = zip32_master_key_i(); + crate::bolos::heartbeat(); let mut key_bundle_i = SaplingKeyBundle::new( zip32_sapling_ask_m(&ik.spending_key()), diff --git a/app/rust/src/zip32_extern.rs b/app/rust/src/zip32_extern.rs index 5be8b948..7df5ee09 100644 --- a/app/rust/src/zip32_extern.rs +++ b/app/rust/src/zip32_extern.rs @@ -151,19 +151,25 @@ pub extern "C" fn get_pkd_from_seed( pkd_ptr: *mut [u8; 32], ) { crate::bolos::heartbeat(); + let path = [ZIP32_PURPOSE, ZIP32_COIN_TYPE, account]; let start = unsafe { &mut *start_diversifier }; let div_out = unsafe { &mut *div_ptr }; let key_bundle = zip32_sapling_derive(&path); + crate::bolos::heartbeat(); + let dk = key_bundle.dk(); + crate::bolos::heartbeat(); div_out.copy_from_slice(&zip32::diversifier_find_valid(&dk, start)); crate::bolos::heartbeat(); let ivk = sapling_asknsk_to_ivk(&key_bundle.ask(), &key_bundle.nsk()); crate::bolos::heartbeat(); + let tmp_pkd = zip32::pkd_default(&ivk, div_out); + crate::bolos::heartbeat(); let pkd_out = unsafe { &mut *pkd_ptr }; pkd_out.copy_from_slice(&tmp_pkd); diff --git a/tests_zemu/snapshots/fl-mainmenu/00004.png b/tests_zemu/snapshots/fl-mainmenu/00004.png index c485912c..9dde1f1d 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 5b96732c..c9d2f633 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 5b96732c..c9d2f633 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 99e198ef..88f6ff5e 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 99e198ef..88f6ff5e 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 34fa68e0..3bcd2b23 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 99e198ef..88f6ff5e 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 99e198ef..88f6ff5e 100644 Binary files a/tests_zemu/snapshots/x-mainmenu/00010.png and b/tests_zemu/snapshots/x-mainmenu/00010.png differ