pub struct Challenges {
pub challenges: [XFieldElement; 63],
}
Expand description
The Challenges
struct holds the challenges used in Triton VM. The concrete
challenges are known only at runtime. The challenges are indexed using enum
ChallengeId
. The Challenges
struct is essentially a thin wrapper
around an array of XFieldElement
s, providing convenience methods.
Fields§
§challenges: [XFieldElement; 63]
Implementations§
Source§impl Challenges
impl Challenges
Sourcepub const SAMPLE_COUNT: usize = 59usize
pub const SAMPLE_COUNT: usize = 59usize
The number of weights to sample using the Fiat-Shamir heuristic. This number is lower than the number of challenges because several challenges are not sampled, but computed from publicly known values and other, sampled challenges.
Concretely:
- The
StandardInputTerminal
is computed from Triton VM’s public input and the sampled indeterminateStandardInputIndeterminate
. - The
StandardOutputTerminal
is computed from Triton VM’s public output and the sampled indeterminateStandardOutputIndeterminate
. - The
LookupTablePublicTerminal
is computed from the publicly known and constant lookup table and the sampled indeterminateLookupTablePublicIndeterminate
. - The
CompressedProgramDigest
is computed from the program to be executed and the sampled indeterminateCompressProgramDigestIndeterminate
.
pub fn new(challenges: Vec<XFieldElement>, claim: &Claim) -> Self
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for Challenges
impl<'arbitrary> Arbitrary<'arbitrary> for Challenges
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
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>
Generate an arbitrary value of
Self
from the entirety of the given
unstructured data. Read moreSource§impl Clone for Challenges
impl Clone for Challenges
Source§fn clone(&self) -> Challenges
fn clone(&self) -> Challenges
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Challenges
impl Debug for Challenges
Source§impl Index<ChallengeId> for Challenges
impl Index<ChallengeId> for Challenges
Source§type Output = XFieldElement
type Output = XFieldElement
The returned type after indexing.
Source§impl Index<Range<ChallengeId>> for Challenges
impl Index<Range<ChallengeId>> for Challenges
Source§impl Index<RangeInclusive<ChallengeId>> for Challenges
impl Index<RangeInclusive<ChallengeId>> for Challenges
Source§type Output = [XFieldElement]
type Output = [XFieldElement]
The returned type after indexing.
Source§fn index(&self, indices: RangeInclusive<ChallengeId>) -> &Self::Output
fn index(&self, indices: RangeInclusive<ChallengeId>) -> &Self::Output
Performs the indexing (
container[index]
) operation. Read moreSource§impl Index<RangeInclusive<usize>> for Challenges
impl Index<RangeInclusive<usize>> for Challenges
Auto Trait Implementations§
impl Freeze for Challenges
impl RefUnwindSafe for Challenges
impl Send for Challenges
impl Sync for Challenges
impl Unpin for Challenges
impl UnwindSafe for Challenges
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
Mutably borrows from an owned value. Read more
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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>
Converts
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>
Converts
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