Scalar Field Mapping & Batch Operations for Curve and Field Elements
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:
- Write the
mapToBaseField()
function for computing $\frac{x}{y}$ and returning as an $F_p$ element MapToScalarField()
for converting the $F_p$ element to $F_r$, in between it is done by first converting $F_p$ -> Bytes -> $F_r$- Tests for
mapToBaseField()
&MapToScalarField()
- Adding the
BatchMapToField()
, this does the same operations but for a batch of Banderwagon points together - Adding
BatchInversion
, this is the batch inversion of the points on the Banderwagon curve with the montgomery trick for faster inversion - 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