Skip to content

Update verify_from_secret_in_secret_leaf_index.rs#163

Closed
skaunov wants to merge 1 commit intoTritonVM:masterfrom
skaunov:patch-3
Closed

Update verify_from_secret_in_secret_leaf_index.rs#163
skaunov wants to merge 1 commit intoTritonVM:masterfrom
skaunov:patch-3

Conversation

@skaunov
Copy link
Contributor

@skaunov skaunov commented Nov 21, 2025

it aren't the pointers here, right?

it aren't the pointers here, right?
@Sword-Smith
Copy link
Contributor

Those are absolutely pointers. Pointers is the only way that lists are represented on stack. The data for lists (peaks is Vec<Digest>) always lives in memory.

@skaunov
Copy link
Contributor Author

skaunov commented Nov 22, 2025

ah, that's why it's Box I guess
makes sense, thank you!

@skaunov
Copy link
Contributor Author

skaunov commented Nov 22, 2025

Is https://docs.rs/tasm-lib/latest/tasm_lib/data_type/enum.DataType.html#method.read_value_from_input quite misleading then? @jan-ferdinand

I mean will it then read just one word which I guess will the start of the encoding?

If I want to use the method for the following -- how do I do that?

        let to_be_call = DataType::StructRef(
            StructType{ name: "MmrAccumulator".into(), fields: vec!(
                ("leaf_count".into(), DataType::U64), ("peaks".into(), DataType::List(DataType::Digest.into()))
            ) }
        ).read_value_from_input(tasm_lib::io::InputSource::StdIn);

@skaunov
Copy link
Contributor Author

skaunov commented Nov 23, 2025

and the same question on https://docs.rs/tasm-lib/latest/tasm_lib/macro.field_with_size.html as I saw that stack size method used quite often internally

@Sword-Smith
Copy link
Contributor

Is https://docs.rs/tasm-lib/latest/tasm_lib/data_type/enum.DataType.html#method.read_value_from_input quite misleading then? @jan-ferdinand

I mean will it then read just one word which I guess will the start of the encoding?

If I want to use the method for the following -- how do I do that?

        let to_be_call = DataType::StructRef(
            StructType{ name: "MmrAccumulator".into(), fields: vec!(
                ("leaf_count".into(), DataType::U64), ("peaks".into(), DataType::List(DataType::Digest.into()))
            ) }
        ).read_value_from_input(tasm_lib::io::InputSource::StdIn);

It seems to me that that method can only be used to read stack-based values (tuples, and primitive types like BFieldElement, Digest, u128 etc.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants