Advaita Saha

TECH

Scalar Field Mapping & Batch Operations for Curve and Field Elements

epf

So in the Banderwagon PR, if you have seen it in details, one of the things which were mentioned in the specs, but was not there in thr PR was MapToScalarField.
This was suggested by @mamy to leave for the time being, and add it separetely later in a different folder structure. So this week I worked on the following things:

  1. Write the mapToBaseField() function for computing xy\frac{x}{y} and returning as an FpF_p element
  2. MapToScalarField() for converting the FpF_p element to FrF_r, in between it is done by first converting FpF_p -> Bytes -> FrF_r
  3. Tests for mapToBaseField() & MapToScalarField()
  4. Adding the BatchMapToField(), this does the same operations but for a batch of Banderwagon points together
  5. Adding BatchInversion, this is the batch inversion of the points on the Banderwagon curve with the montgomery trick for faster inversion
  6. Tests for the Batch Operations

Track the issue -> here and the PR -> here.
The PR have been complited and waiting a review from @mamy before it can be merged. The BatchInversion might be need to optimized a bit, the rest seems perfect in my eyes, & hoping it gets merged soon enough

After this merge is done, I have following plans for the next week:

  • Add the Batch Operations for Serialization & Deserialization
  • Import the constantine library into nim-eth-verkle as a git submodule
  • Go a benchmarking of my Banderwagon implementation, and compare it’s performace with the go-ipa banderwagon implementation