Prototype of the modular multiplication algorithm described in this paper https://blog.polygon.technology/wp-content/uploads/2022/10/casting-3.pdf
This Repository contains the following:
circuits/src/main.nr
is a simple example that validates a modular multiplication product using the nondetermnistic methodcircuits/Prover.toml
contains the witness datajs/helper.ts
contains some helper functions that- generates the required parameters for a given modulo (
q
) - generates the witness data for validating the modular product (
z_mod_q
) given multiplicands (x
&y
)
- generates the required parameters for a given modulo (
Edit js/helper.ts
with the x
, y
, and q
for which you want to compute the product.
# From the js directory
npm run generate-params
Copy the parameters into the modular multiplication circuit circuits/src/main.nr
Copy the witness data into circuits/Prover.toml
# From the circuits directory
nargo prove main