tasm_lib/verifier/challenges/
shared.rs

1use triton_vm::prelude::*;
2
3use crate::data_type::ArrayType;
4use crate::data_type::DataType;
5use crate::data_type::StructType;
6
7pub(super) fn challenges_data_type(total_number_of_challenges: usize) -> DataType {
8    DataType::StructRef(StructType {
9        name: "Challenges".to_owned(),
10        fields: vec![(
11            "challenges".to_owned(),
12            DataType::Array(Box::new(ArrayType {
13                element_type: DataType::Xfe,
14                length: total_number_of_challenges,
15            })),
16        )],
17    })
18}
19
20pub(crate) fn conventional_challenges_pointer() -> BFieldElement {
21    // By convention, the challenges are stored in the fourth-to-last
22    // memory page
23    BFieldElement::new(((1 << 32) - 4) * (1 << 32))
24}