pub struct OpStack {
pub stack: Vec<BFieldElement>,
/* private fields */
}Expand description
The operational stack of Triton VM.
It always contains at least OpStackElement::COUNT elements. Initially, the bottom-most
DIGEST_LENGTH elements equal the digest of the program being executed.
The remaining elements are initially 0.
The OpStack is represented as one contiguous piece of memory, and Triton VM uses it as such.
For reasons of arithmetization, however, there is a distinction between the op-stack registers
and the op-stack underflow memory. The op-stack registers are the first
OpStackElement::COUNT elements of the op-stack, and the op-stack underflow memory is the
remaining elements.
Fields§
§stack: Vec<BFieldElement>The underlying, actual stack. When manually accessing, be aware of reversed indexing:
while op_stack[0] is the top of the stack, op_stack.stack[0] is the lowest element in
the stack.
Implementations§
Trait Implementations§
source§impl<'arbitrary> Arbitrary<'arbitrary> for OpStack
impl<'arbitrary> Arbitrary<'arbitrary> for OpStack
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<'de> Deserialize<'de> for OpStack
impl<'de> Deserialize<'de> for OpStack
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 Index<OpStackElement> for OpStack
impl Index<OpStackElement> for OpStack
§type Output = BFieldElement
type Output = BFieldElement
source§impl IndexMut<OpStackElement> for OpStack
impl IndexMut<OpStackElement> for OpStack
source§impl IntoIterator for OpStack
impl IntoIterator for OpStack
source§impl PartialEq for OpStack
impl PartialEq for OpStack
impl Eq for OpStack
impl StructuralPartialEq for OpStack
Auto Trait Implementations§
impl Freeze for OpStack
impl RefUnwindSafe for OpStack
impl Send for OpStack
impl Sync for OpStack
impl Unpin for OpStack
impl UnwindSafe for OpStack
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> 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