It seems that the line of code at the bottom can be moved to the beginning of the buildBn128 function so that after the curve is cached, the code before it is not executed each time.
Moving that line to the beginning could potentially make proof verification and generation much faster (after the curve is cached).
It seems that the line of code at the bottom can be moved to the beginning of the
buildBn128
function so that after the curve is cached, the code before it is not executed each time.Moving that line to the beginning could potentially make proof verification and generation much faster (after the curve is cached).
https://github.com/iden3/ffjavascript/blob/2980e48dde8f800655ffba293b848b29e7425455/src/bn128.js#L35
The same happens within
buildBls12381
.