This documentation describes two projects undertaken as part of the Zprize competition in 2022.

Our submitted code is available on github here! (It will be made public after all competitions' deadline.)

The main submission document for msm is available with various design decisions on github as a README.

This is a competition to implement a multi-scalar multiplication. In particular, the goal is to multiply 2^{26} BLS12-377 G1 affine points by 253 bit scalars from the associated scalar field and add the result as fast as possible.

This is the submission for the FPGA track.

The main libraries that implements this include

`Msm_pippenger`

implements the complete MSM computation using the Pippenger bucket method.`Pippenger`

implements the controller logic to sequence the MSM computation.`Field_ops_lib`

implements the core field arithmetic operations (modulo multiplications etc.)`Twisted_edwards_lib`

implements the mixed addition in the twisted edwards curve.

Some modules with interesting implementation are (but not limited to!):

`Twisted_edwards_lib.Mixed_add_precompute`

- A fully pipelined mixed adder for points in the scaled twisted edwards curve with heavy precomputation.`Field_ops_lib.Bram_reduce`

- Perform the fine reduction stage of barrett reduction using BRAMs.`Msm_pippenger.Scalar_transformation`

- Transforms scalars into a signed digit representation.

The main submission document for the NTT Acceleration contest is available in the `zprize_ntt_top`

page

In this competition, we create a FPGA design that performs a 2^{24} inverse number theoretic transform over a 64 bit finite field.

The other documentation pages for this competition include:

- Hardcaml_ntt - documentation about the design of the main mini NTT core
`zprize_ntt_build_instructions`

- Building and testing instructions