diff --git a/assets/dusk_wallet_core.wasm b/assets/dusk_wallet_core.wasm index 3532630..bc9f75d 100755 Binary files a/assets/dusk_wallet_core.wasm and b/assets/dusk_wallet_core.wasm differ diff --git a/src/ffi.rs b/src/ffi.rs index d40d79b..d8a8b67 100644 --- a/src/ffi.rs +++ b/src/ffi.rs @@ -419,14 +419,11 @@ pub fn nullifiers(args: i32, len: i32) -> i64 { core::array::from_fn(|i| key::derive_vk(&seed, i as _)); for note in notes { - for idx in 0..MAX_KEY { - if vks[idx].owns(¬e) { - nullifiers.push(note.gen_nullifier(&sks[idx])); - break; - } - } + let Some(vk_idx) = vks.iter().position(|vk| vk.owns(¬e)) else { + return utils::fail(); + }; - return utils::fail(); + nullifiers.push(note.gen_nullifier(&sks[vk_idx])); } utils::rkyv_into_ptr(nullifiers)