pub struct ProgramInputs { /* private fields */ }
Expand description

Input container for Miden VM programs.

Miden VM programs can receive inputs in two ways:

  1. The stack can be initialized to some set of values at the beginning of the program. These inputs are public and must be shared with the verifier for them to verify a proof of the correct execution of a Miden program. There is no limit to the number of elements at the top of the stack which can receive an initial value.
  2. The program may request nondeterministic advice inputs from the prover. These inputs are secret inputs. This means that the prover does not need to share them with the verifier. There are two types of advice inputs: (1) a single advice tape which can contain any number of elements and (2) a list of advice sets, which are used to provide nondeterministic inputs for instructions which work with Merkle trees.

TODO: add more detailed explanation.

Implementations

Returns ProgramInputs instantiated with the specified initial stack values, advice tape values, and advice sets.

The initial stack values are put onto the stack in the order as if they were pushed onto the stack one by one. The result of this is that the last value in the stack_init slice will end up at the top of the stack.

Errors

Returns an error if:

  • The number initial stack values is greater than 16.
  • Any of the initial stack values or the advice tape values are not valid field elements.
  • Any of the advice sets have the same root.

Returns ProgramInputs instantiated with the specified initial stack values, advice tape, key-value advice map, and advice sets.

The initial stack values are put onto the stack in the order as if they were pushed onto the stack one by one. The result of this is that the last value in the stack_init slice will end up at the top of the stack.

Errors

Returns an error if:

  • The number initial stack values is greater than 16.
  • Any of the initial stack values or the advice tape values are not valid field elements.
  • Any of the advice sets have the same root.

Returns ProgramInputs initialized with stack inputs only.

The provided inputs are pushed onto the stack one after the other. Thus, the first element in the stack_init list will be the deepest in the stack.

Advice tape and advice sets for the returned inputs are blank.

Errors

Returns an error if:

  • The number initial stack values is greater than 16.
  • Any of the initial stack values is not valid field elements.

Returns ProgramInputs with no input values.

Returns a reference to the initial stack values.

Returns a reference to the advice tape.

Decomposes these ProgramInputs into their raw components.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.