tasm_lib/verifier/claim/
shared.rsuse crate::data_type::DataType;
use crate::data_type::StructType;
pub(crate) fn claim_type() -> StructType {
StructType {
name: "Claim".to_owned(),
fields: vec![
("program_digest".to_owned(), DataType::Digest),
("version".to_owned(), DataType::U32),
("input".to_owned(), DataType::List(Box::new(DataType::Bfe))),
("output".to_owned(), DataType::List(Box::new(DataType::Bfe))),
],
}
}
#[cfg(test)]
use triton_vm::prelude::*;
#[cfg(test)]
pub(crate) fn insert_claim_into_static_memory(
memory: &mut std::collections::HashMap<BFieldElement, BFieldElement>,
claim: &Claim,
) -> (BFieldElement, u32) {
let size_of_encoded_claim: u32 = claim.encode().len().try_into().unwrap();
let size_as_i32: i32 = size_of_encoded_claim.try_into().unwrap();
let claim_pointer = bfe!(-size_as_i32 - 1);
crate::memory::encode_to_memory(memory, claim_pointer, claim);
(claim_pointer, size_of_encoded_claim)
}