This commit is contained in:
wborgeaud 2022-07-22 19:25:06 +02:00
parent e93235d07e
commit 0afe98525b
2 changed files with 4 additions and 6 deletions

View File

@ -28,13 +28,9 @@
// Computes the inverse modulo N by providing it non-deterministically.
%macro inverse
// stack: x
PROVER_INPUT
PROVER_INPUT(ff::bn254_base::inverse)
// stack: x^-1, x
%bn_base
// stack: N, x^-1, x
DUP3
// stack: x, N, x^-1, x
DUP3
%stack (inv, x) -> (inv, x, @BN_BASE, inv, x)
// stack: x^-1, x, N, x^-1, x
MULMOD
// stack: x^-1 * x, x^-1, x

View File

@ -29,6 +29,8 @@ local_label = { identifier ~ ":" }
bytes_item = { ^"BYTES " ~ literal ~ ("," ~ literal)* }
push_instruction = { ^"PUSH " ~ push_target }
push_target = { literal | identifier | variable | constant }
prover_input_instruction = { ^"PROVER_INPUT " ~ "(" ~ prover_input_fn ~ ")" } // TODO: Can also support extra arguments.
prover_input_fn = { identifier ~ ("::" ~ identifier)*}
nullary_instruction = { identifier }
file = { SOI ~ item* ~ silent_eoi }