Field operations
In this section we describe the AIR constraints for Miden VM field operations (i.e., arithmetic operations over field elements).
ADD
¶
Assume ADD
operation computes
Stack transition for this operation must satisfy the following constraints:
The effect on the rest of the stack is:
* Left shift starting from position
NEG
¶
Assume NEG
operation computes
Stack transition for this operation must satisfy the following constraints:
The effect on the rest of the stack is:
* No change starting from position
MUL
¶
Assume MUL
operation computes
Stack transition for this operation must satisfy the following constraints:
The effect on the rest of the stack is:
* Left shift starting from position
INV
¶
Assume INV
operation computes
Stack transition for this operation must satisfy the following constraints:
Note that the above constraint can be satisfied only if the value in
The effect on the rest of the stack is:
* No change starting from position
INCR
¶
Assume INCR
operation computes
Stack transition for this operation must satisfy the following constraints:
The effect on the rest of the stack is:
* No change starting from position
NOT
¶
Assume NOT
operation computes
Stack transition for this operation must satisfy the following constraints:
The first constraint ensures that the value in NOT
operation.
The effect on the rest of the stack is:
* No change starting from position
AND
¶
Assume AND
operation computes
Stack transition for this operation must satisfy the following constraints:
The first two constraints ensure that the value in AND
operation.
The effect on the rest of the stack is:
* Left shift starting from position
OR
¶
Assume OR
operation computes
Stack transition for this operation must satisfy the following constraints:
The first two constraints ensure that the value in OR
operation.
The effect on the rest of the stack is:
* Left shift starting from position
EQ
¶
Assume EQ
operation computes
Stack transition for this operation must satisfy the following constraints:
To satisfy the above constraints, the prover must populate the value of helper register
- If
, set . - Otherwise, set
to any value (e.g., ).
The effect on the rest of the stack is:
* Left shift starting from position
EQZ
¶
Assume EQZ
operation computes
Stack transition for this operation must satisfy the following constraints:
To satisfy the above constraints, the prover must populate the value of helper register
The effect on the rest of the stack is:
- No change starting from position
.
EXPACC
¶
The EXPACC
operation pops top
Stack transition for this operation must satisfy the following constraints:
bit
should be a binary.
The exp
in the next frame should be the square of the exp
in the current frame.
The value val
in the helper register is computed correctly using the bit
and exp
in next and current frame respectively.
The acc
in the next frame is the product of val
and acc
in the current frame.
b
in the next frame is the right shift of b
in the current frame.
The effect on the rest of the stack is:
- No change starting from position
.
EXT2MUL
¶
The EXT2MUL
operation pops top
Stack transition for this operation must satisfy the following constraints:
The first stack element should be unchanged in the next frame.
The second stack element should be unchanged in the next frame.
The third stack element should satisfy the following constraint.
The fourth stack element should satisfy the following constraint.
The effect on the rest of the stack is:
- No change starting from position
.