Skip to content

Commit

Permalink
derive trait GetSize for Proof instead of implementing it manually
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-ferdinand committed Aug 6, 2023
1 parent 01e03ae commit 6ffa9e3
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions triton-vm/src/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,9 @@ use crate::stark;

/// Contains the necessary cryptographic information to verify a computation.
/// Should be used together with a [`Claim`].
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, BFieldCodec)]
#[derive(Debug, Clone, GetSize, Serialize, Deserialize, PartialEq, Eq, BFieldCodec)]
pub struct Proof(pub Vec<BFieldElement>);

impl GetSize for Proof {
fn get_stack_size() -> usize {
std::mem::size_of::<Self>()
}

fn get_heap_size(&self) -> usize {
self.0.len() * std::mem::size_of::<BFieldElement>()
}
}

impl Proof {
/// Get the height of the trace used during proof generation.
/// This is an upper bound on the length of the computation this proof is for.
Expand Down

0 comments on commit 6ffa9e3

Please sign in to comment.