Enum miden_processor::AdviceExtractor
source · pub enum AdviceExtractor {
PopStack,
PopStackWord,
PopStackDWord,
GetMerklePath,
}Expand description
Defines a set of actions which can be initiated from the VM to extract data from the advice provider. These actions can only modify the advice stack.
Variants§
PopStack
Pops an element from the advice stack and returns it.
§Errors
Returns an error if the advice stack is empty.
Inputs: Operand stack: […] Advice stack: [value, …] Advice map: {…} Merkle store: {…}
Outputs: Operand stack: […] Advice stack: […] Advice map: {…} Merkle store: {…} Return: [value]
PopStackWord
Pops a word (4 elements) from the advice stack and returns it.
Note: a word is popped off the stack element-by-element. For example, a [d, c, b, a, ...]
stack (i.e., d is at the top of the stack) will yield [d, c, b, a].
§Errors
Returns an error if the advice stack does not contain a full word.
Inputs: Operand stack: […] Advice stack: [d, c, b, a, …] Advice map: {…} Merkle store: {…}
Outputs: Operand stack: […] Advice stack: […] Advice map: {…} Merkle store: {…} Return: [a, b, c, d]
PopStackDWord
Pops a double word (8 elements) from the advice stack and returns them.
Note: words are popped off the stack element-by-element. For example, a
[h, g, f, e, d, c, b, a, ...] stack (i.e., h is at the top of the stack) will yield
two words: [h, g, f,e ], [d, c, b, a].
§Errors
Returns an error if the advice stack does not contain two words.
Inputs: Operand stack: […] Advice stack: [h, g, f, e, d, c, b, a, …] Advice map: {…} Merkle store: {…}
Outputs: Operand stack: […] Advice stack: […] Advice map: {…} Merkle store: {…} Return: [a, b, c, d, e, f, g, h]
GetMerklePath
Extracts a Merkle path for the node specified by the values at the top of the operand stack and returns it to the caller.
§Errors
Returns an error if the Merkle store does not contain the specified Merkle path.
Inputs: Operand stack: [WORD, depth, index, ROOT, …] Advice stack: […] Advice map: {…} Merkle store: {path, …}
Outputs: Operand stack: [WORD, depth, index, ROOT, …] Advice stack: […] Advice map: {…} Merkle store: {path, …} Return: [path]
Trait Implementations§
source§impl Clone for AdviceExtractor
impl Clone for AdviceExtractor
source§fn clone(&self) -> AdviceExtractor
fn clone(&self) -> AdviceExtractor
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for AdviceExtractor
impl Debug for AdviceExtractor
source§impl Display for AdviceExtractor
impl Display for AdviceExtractor
source§impl PartialEq for AdviceExtractor
impl PartialEq for AdviceExtractor
impl Copy for AdviceExtractor
impl Eq for AdviceExtractor
impl StructuralPartialEq for AdviceExtractor
Auto Trait Implementations§
impl Freeze for AdviceExtractor
impl RefUnwindSafe for AdviceExtractor
impl Send for AdviceExtractor
impl Sync for AdviceExtractor
impl Unpin for AdviceExtractor
impl UnwindSafe for AdviceExtractor
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)