pub struct Claim {
pub program_digest: Digest,
pub version: u32,
pub input: Vec<BFieldElement>,
pub output: Vec<BFieldElement>,
}
Expand description
Contains the public information of a verifiably correct computation.
A corresponding Proof
is needed to verify the computation.
One additional piece of public information not explicitly listed in the Claim
is the
padded_height
, an upper bound on the length of the computation.
It is derivable from a Proof
by calling Proof::padded_height()
.
Fields§
§program_digest: Digest
The hash digest of the program that was executed. The hash function in use is Tip5
.
version: u32
The version of the Triton VM instruction set architecture the
program_digest
is about, as well as of the STARK proof system
in use. See also: CURRENT_VERSION
.
input: Vec<BFieldElement>
The public input to the computation.
output: Vec<BFieldElement>
The public output of the computation.
Implementations§
Source§impl Claim
impl Claim
Sourcepub fn new(program_digest: Digest) -> Self
pub fn new(program_digest: Digest) -> Self
Create a new Claim.
Assumes the version to be CURRENT_VERSION
. The version can be changed
with method about_version
.
pub fn about_program(program: &Program) -> Self
pub fn with_input(self, input: impl Into<Vec<BFieldElement>>) -> Self
pub fn with_output(self, output: Vec<BFieldElement>) -> Self
pub fn about_version(self, version: u32) -> Self
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for Claim
impl<'arbitrary> Arbitrary<'arbitrary> for Claim
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self
from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self
from the entirety of the given
unstructured data. Read moreSource§impl BFieldCodec for Claim
impl BFieldCodec for Claim
type Error = ClaimBFieldDecodingError
fn decode(sequence: &[BFieldElement]) -> Result<Box<Self>, Self::Error>
fn encode(&self) -> Vec<BFieldElement>
Source§fn static_length() -> Option<usize>
fn static_length() -> Option<usize>
Source§impl<'de> Deserialize<'de> for Claim
impl<'de> Deserialize<'de> for Claim
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl GetSize for Claim
impl GetSize for Claim
Source§fn get_heap_size(&self) -> usize
fn get_heap_size(&self) -> usize
Source§fn get_stack_size() -> usize
fn get_stack_size() -> usize
impl Eq for Claim
impl StructuralPartialEq for Claim
Auto Trait Implementations§
impl Freeze for Claim
impl RefUnwindSafe for Claim
impl Send for Claim
impl Sync for Claim
impl Unpin for Claim
impl UnwindSafe for Claim
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more