From b6d490d05300a9db9cdf9929baa9b984bee9f3f6 Mon Sep 17 00:00:00 2001 From: Rene Vergara Date: Mon, 28 Oct 2024 12:25:34 -0500 Subject: [PATCH] fix(rust): orchard hash length check --- librustzcash-wrapper/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/librustzcash-wrapper/src/lib.rs b/librustzcash-wrapper/src/lib.rs index df054c6..1673061 100644 --- a/librustzcash-wrapper/src/lib.rs +++ b/librustzcash-wrapper/src/lib.rs @@ -1590,7 +1590,7 @@ pub extern "C" fn rust_wrapper_combine_orchard_nodes( ){ let left_in: Vec = marshall_from_haskell_var(left, left_len, RW); let right_in: Vec = marshall_from_haskell_var(right, right_len, RW); - if left_in.len() > 1 { + if left_in.len() == 1 { let n = MerkleHashOrchard::combine(Level::new(level), &MerkleHashOrchard::empty_leaf(), &MerkleHashOrchard::empty_leaf()); let h = Hhex { bytes: n.to_bytes().to_vec() }; marshall_to_haskell_var(&h, out, out_len, RW);