Hi,
So I have these lines of codes,
let hash_bits = multipack::bytes_to_bits_le(&hash);
let value_bits = multipack::bytes_to_bits_le(&value);
After I checked the function page sapling_crypto_ce::circuit::multipack::bytes_to_bits_le - Rust , I understand that the result is vector of booleans and since I need to combine them, I do following,
let inputs_bits = hash_bits.extend(value_bits.iter().cloned());
let inputs = multipack::compute_multipacking(&inputs_bits);
But I get an error
error[E0308]: mismatched types
--> src/main.rs:46:47
|
46 | let inputs = multipack::compute_multipacking(&inputs_bits);
| ^^^^^^^^^^^^ expected slice `[bool]`, found `()`
|
= note: expected reference `&[bool]`
found reference `&()`
Similarly, later,
// Expose the vector of 32 boolean variables as compact public inputs.
multipack::pack_into_inputs(cs.namespace(|| "document-verify"), &hash_f)
I get similar error,
error[E0308]: mismatched types
--> src/main.rs:169:73
|
169 | multipack::pack_into_inputs(cs.namespace(|| "document-verify"), &hash_f)
| ^^^^^^^ expected slice, found `()`
|
= note: expected reference `&[Boolean]`
found reference `&()`
Any idea how I can fix them?
Thanks!